forked from github/server
Merge branch 'master' of github.com:ennorehling/eressea
This commit is contained in:
commit
caf8f1de9d
2
clibs
2
clibs
|
@ -1 +1 @@
|
||||||
Subproject commit abe774f70265de14ea7f5e530518ca130562a9c9
|
Subproject commit 484fbf23e34f6844f1c4e3f685bb6c53cadf5bfe
|
|
@ -11,11 +11,11 @@ package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
||||||
|
|
||||||
config.rules = 'e2'
|
config.rules = 'e2'
|
||||||
|
|
||||||
|
lunit = require 'lunit'
|
||||||
require 'eressea'
|
require 'eressea'
|
||||||
require 'eressea.xmlconf'
|
require 'eressea.xmlconf'
|
||||||
require 'eressea.path'
|
require 'eressea.path'
|
||||||
require 'tests.e2'
|
require 'tests.e2'
|
||||||
require 'lunit'
|
|
||||||
|
|
||||||
rng.inject(0)
|
rng.inject(0)
|
||||||
eressea.settings.set("rules.food.flags", "4")
|
eressea.settings.set("rules.food.flags", "4")
|
||||||
|
|
|
@ -11,11 +11,11 @@ package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
||||||
|
|
||||||
config.rules = 'e3'
|
config.rules = 'e3'
|
||||||
|
|
||||||
|
lunit = require 'lunit'
|
||||||
require 'eressea'
|
require 'eressea'
|
||||||
require 'eressea.path'
|
require 'eressea.path'
|
||||||
require 'eressea.xmlconf'
|
require 'eressea.xmlconf'
|
||||||
require 'tests.e3'
|
require 'tests.e3'
|
||||||
require 'lunit'
|
|
||||||
|
|
||||||
rng.inject(0)
|
rng.inject(0)
|
||||||
eressea.settings.set("rules.alliances", "0")
|
eressea.settings.set("rules.alliances", "0")
|
||||||
|
|
|
@ -9,9 +9,9 @@ if config.install then
|
||||||
end
|
end
|
||||||
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
|
||||||
|
|
||||||
|
lunit = require 'lunit'
|
||||||
require 'eressea'
|
require 'eressea'
|
||||||
require 'eressea.path'
|
require 'eressea.path'
|
||||||
require 'tests'
|
require 'tests'
|
||||||
require 'lunit'
|
|
||||||
result = lunit.main()
|
result = lunit.main()
|
||||||
return result.errors + result.failed
|
return result.errors + result.failed
|
||||||
|
|
|
@ -385,6 +385,9 @@ message * give_ship(unit *u1, unit *u2, int n, order *ord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (u2->building) {
|
||||||
|
leave_building(u2);
|
||||||
|
}
|
||||||
if (n < u1->ship->number) {
|
if (n < u1->ship->number) {
|
||||||
ship * sh = new_ship(u1->ship->type, u1->region, u1->faction->locale);
|
ship * sh = new_ship(u1->ship->type, u1->region, u1->faction->locale);
|
||||||
scale_ship(sh, 0);
|
scale_ship(sh, 0);
|
||||||
|
|
|
@ -376,7 +376,7 @@ unit *read_unit(gamedata *data)
|
||||||
{
|
{
|
||||||
unit *u;
|
unit *u;
|
||||||
const race *rc;
|
const race *rc;
|
||||||
int number, n, p;
|
int number, n, p, bn, sn;
|
||||||
order **orderp;
|
order **orderp;
|
||||||
char obuf[DISPLAYSIZE];
|
char obuf[DISPLAYSIZE];
|
||||||
faction *f;
|
faction *f;
|
||||||
|
@ -443,9 +443,10 @@ unit *read_unit(gamedata *data)
|
||||||
else
|
else
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
|
|
||||||
READ_INT(data->store, &n);
|
READ_INT(data->store, &bn);
|
||||||
if (n > 0) {
|
READ_INT(data->store, &sn);
|
||||||
building * b = findbuilding(n);
|
if (sn <= 0 && bn > 0) {
|
||||||
|
building * b = findbuilding(bn);
|
||||||
if (b) {
|
if (b) {
|
||||||
u_set_building(u, b);
|
u_set_building(u, b);
|
||||||
if (fval(u, UFL_OWNER)) {
|
if (fval(u, UFL_OWNER)) {
|
||||||
|
@ -453,13 +454,12 @@ unit *read_unit(gamedata *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error("read_unit: unit in unkown building '%s'", itoa36(n));
|
log_error("read_unit: unit in unkown building '%s'", itoa36(bn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_INT(data->store, &n);
|
if (sn > 0) {
|
||||||
if (n > 0) {
|
ship * sh = findship(sn);
|
||||||
ship * sh = findship(n);
|
|
||||||
if (sh) {
|
if (sh) {
|
||||||
u_set_ship(u, sh);
|
u_set_ship(u, sh);
|
||||||
if (fval(u, UFL_OWNER)) {
|
if (fval(u, UFL_OWNER)) {
|
||||||
|
@ -467,7 +467,7 @@ unit *read_unit(gamedata *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error("read_unit: unit in unkown ship '%s'", itoa36(n));
|
log_error("read_unit: unit in unkown ship '%s'", itoa36(sn));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -635,7 +635,7 @@ void leave_ship(unit * u)
|
||||||
{
|
{
|
||||||
struct ship *sh = u->ship;
|
struct ship *sh = u->ship;
|
||||||
|
|
||||||
u->ship = 0;
|
u->ship = NULL;
|
||||||
if (sh->_owner == u) {
|
if (sh->_owner == u) {
|
||||||
ship_update_owner(sh);
|
ship_update_owner(sh);
|
||||||
sh->_owner = ship_owner(sh);
|
sh->_owner = ship_owner(sh);
|
||||||
|
@ -647,7 +647,7 @@ void leave_building(unit * u)
|
||||||
{
|
{
|
||||||
building * b = u->building;
|
building * b = u->building;
|
||||||
|
|
||||||
u->building = 0;
|
u->building = NULL;
|
||||||
if (b->_owner == u) {
|
if (b->_owner == u) {
|
||||||
building_update_owner(b);
|
building_update_owner(b);
|
||||||
assert(b->_owner != u);
|
assert(b->_owner != u);
|
||||||
|
|
Loading…
Reference in New Issue