forked from github/server
Merge pull request #698 from ennorehling/develop
fix failing preview build for E2 turn 1028
This commit is contained in:
commit
72d46df7d7
|
@ -917,6 +917,7 @@ void free_region(region * r)
|
|||
while (r->units) {
|
||||
unit *u = r->units;
|
||||
r->units = u->next;
|
||||
u->region = NULL;
|
||||
uunhash(u);
|
||||
free_unit(u);
|
||||
free(u);
|
||||
|
|
|
@ -1707,6 +1707,7 @@ int read_game(gamedata *data) {
|
|||
|
||||
if (data->version < NORCSPELL_VERSION && u_race(u) == rc_spell) {
|
||||
set_observer(r, u->faction, get_level(u, SK_PERCEPTION), u->age);
|
||||
u_setfaction(u, NULL);
|
||||
free_unit(u);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1404,6 +1404,7 @@ int invisible(const unit * target, const unit * viewer)
|
|||
*/
|
||||
void free_unit(unit * u)
|
||||
{
|
||||
assert(!u->region);
|
||||
free(u->_name);
|
||||
free(u->display);
|
||||
free_order(u->thisorder);
|
||||
|
|
|
@ -3010,7 +3010,6 @@ int cast_spell(struct castorder *co)
|
|||
|
||||
fun = get_spellcast(sp->sname);
|
||||
if (!fun) {
|
||||
log_warning("no spell function for %s, try callback", sp->sname);
|
||||
return callbacks.cast_spell(co, fname);
|
||||
}
|
||||
return fun(co);
|
||||
|
|
Loading…
Reference in New Issue