return RET_FAIL;
if ((err = edit_ship(&ship, key, ptr)) != RET_OK)
return err;
- if (!ef_ensure_space(EF_SHIP, ship.shp_uid, 50))
- return RET_FAIL;
if (!putship(ship.shp_uid, &ship))
return RET_FAIL;
break;
return RET_FAIL;
if ((err = edit_land(&land, key, ptr)) != RET_OK)
return err;
- if (!ef_ensure_space(EF_LAND, land.lnd_uid, 50))
- return RET_FAIL;
if (!putland(land.lnd_uid, &land))
return RET_FAIL;
break;
return RET_FAIL;
if ((err = edit_plane(&plane, key, ptr)) != RET_OK)
return err;
- if (!ef_ensure_space(EF_PLANE, plane.pln_uid, 50))
- return RET_FAIL;
if (!putplane(plane.pln_uid, &plane))
return RET_FAIL;
break;
switch (toupper(*key)) {
case 'U':
+ if (arg < 0)
+ return RET_SYN;
+ if (!ef_ensure_space(unit->ef_type, arg, 50)) {
+ pr("Can't copy to %s #%d\n", ef_nameof(unit->ef_type), arg);
+ return RET_FAIL;
+ }
ef_set_uid(unit->ef_type, unit, arg);
break;
case 'O':
Play#0 output Play#0 6 0 640
Play#0 input edit s 0 U 0 U -1
Play#0 command edit
- Play#0 output Play#0 1 command failed
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit s 2 L 3,-1
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit p 0 U 0 U -1
Play#0 command edit
- Play#0 output Play#0 1 command failed
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit p 2 l 3,-1
Play#0 command edit
Play#0 output Play#0 6 0 640
Play#0 input edit u 0 U 0 U -1
Play#0 command edit
- Play#0 output Play#0 1 command failed
+ Play#0 output Play#0 1 Usage: edit <country|land|ship|plane|unit> <NAT|SECT|SHIP|PLANE|LAND> [<KEY> <VALUE>]...
Play#0 output Play#0 6 0 640
Play#0 input edit u 2 L 3,-1
Play#0 command edit
Connect from 127.0.0.1
tester@127.0.0.1 using country #0
tester@127.0.0.1 logged in as country #0
-Oops: id < 0 in ../src/lib/common/file.c:973
-Oops: id < 0 in ../src/lib/common/file.c:973
-Oops: id < 0 in ../src/lib/common/file.c:973
tester@127.0.0.1 logged out, country #0
Shutdown commencing (cleaning up threads.)
Server shutting down on signal 15