Merge pull request #698 from ennorehling/develop

fix failing preview build for E2 turn 1028
This commit is contained in:
Enno Rehling 2017-06-04 14:40:09 +02:00 committed by GitHub
commit 72d46df7d7
4 changed files with 3 additions and 1 deletions

View File

@ -917,6 +917,7 @@ void free_region(region * r)
while (r->units) { while (r->units) {
unit *u = r->units; unit *u = r->units;
r->units = u->next; r->units = u->next;
u->region = NULL;
uunhash(u); uunhash(u);
free_unit(u); free_unit(u);
free(u); free(u);

View File

@ -1707,6 +1707,7 @@ int read_game(gamedata *data) {
if (data->version < NORCSPELL_VERSION && u_race(u) == rc_spell) { if (data->version < NORCSPELL_VERSION && u_race(u) == rc_spell) {
set_observer(r, u->faction, get_level(u, SK_PERCEPTION), u->age); set_observer(r, u->faction, get_level(u, SK_PERCEPTION), u->age);
u_setfaction(u, NULL);
free_unit(u); free_unit(u);
} }
else { else {

View File

@ -1404,6 +1404,7 @@ int invisible(const unit * target, const unit * viewer)
*/ */
void free_unit(unit * u) void free_unit(unit * u)
{ {
assert(!u->region);
free(u->_name); free(u->_name);
free(u->display); free(u->display);
free_order(u->thisorder); free_order(u->thisorder);

View File

@ -3010,7 +3010,6 @@ int cast_spell(struct castorder *co)
fun = get_spellcast(sp->sname); fun = get_spellcast(sp->sname);
if (!fun) { if (!fun) {
log_warning("no spell function for %s, try callback", sp->sname);
return callbacks.cast_spell(co, fname); return callbacks.cast_spell(co, fname);
} }
return fun(co); return fun(co);