disable clone-spell (quit-crash)

fix order of restart and quit command (spell-crash)
This commit is contained in:
Enno Rehling 2006-10-08 11:19:35 +00:00
parent 7e4db04e1b
commit 341b29c401
3 changed files with 13 additions and 9 deletions

View File

@ -3726,7 +3726,7 @@ add_proc_global(int priority, void (*process)(void), const char * name)
while (*pproc) { while (*pproc) {
proc = *pproc; proc = *pproc;
if (proc->priority>priority) break; if (proc->priority>priority) break;
else if (proc->priority==priority && proc->type>=PR_GLOBAL) break; else if (proc->priority==priority && proc->type>PR_GLOBAL) break;
pproc = &proc->next; pproc = &proc->next;
} }
@ -3748,7 +3748,7 @@ add_proc_region(int priority, void (*process)(region *), const char * name)
while (*pproc) { while (*pproc) {
proc = *pproc; proc = *pproc;
if (proc->priority>priority) break; if (proc->priority>priority) break;
else if (proc->priority==priority && proc->type>=PR_REGION) break; else if (proc->priority==priority && proc->type>PR_REGION) break;
pproc = &proc->next; pproc = &proc->next;
} }
@ -3770,7 +3770,7 @@ add_proc_unit(int priority, void (*process)(unit *), const char * name)
while (*pproc) { while (*pproc) {
proc = *pproc; proc = *pproc;
if (proc->priority>priority) break; if (proc->priority>priority) break;
else if (proc->priority==priority && proc->type>=PR_UNIT) break; else if (proc->priority==priority && proc->type>PR_UNIT) break;
pproc = &proc->next; pproc = &proc->next;
} }

View File

@ -2540,6 +2540,9 @@ remove_empty_units_in_region(region *r)
faction * f = u->faction; faction * f = u->faction;
if (!fval(f, FFL_NOTIMEOUT) && f->age > MaxAge()) set_number(u, 0); if (!fval(f, FFL_NOTIMEOUT) && f->age > MaxAge()) set_number(u, 0);
} }
if (u->faction && !u->faction->alive) {
set_number(u, 0);
}
if ((u->number == 0 && u->race != new_race[RC_SPELL]) || (u->age <= 0 && u->race == new_race[RC_SPELL])) { if ((u->number == 0 && u->race != new_race[RC_SPELL]) || (u->age <= 0 && u->race == new_race[RC_SPELL])) {
destroy_unit(u); destroy_unit(u);
if (u->number==0) remove_unit(u); if (u->number==0) remove_unit(u);

View File

@ -236,14 +236,17 @@ destroy_unit(unit * u)
/* Wir machen das erst nach dem Löschen der Items. Der Klon darf keine /* Wir machen das erst nach dem Löschen der Items. Der Klon darf keine
* Items haben, sonst Memory-Leak. */ * Items haben, sonst Memory-Leak. */
#if 0
/* broken. */
clone = has_clone(u); clone = has_clone(u);
if (clone && rng_int()%100 < 90) { if (clone && rng_int()%100 < 90) {
attrib *a; attrib *a;
int i; int i;
/* TODO: Messages generieren. */ /* TODO: Messages generieren. */
u->region = clone->region; if (u->region!=clone->region) {
move_unit(u, clone->region, NULL);
}
u->ship = clone->ship; u->ship = clone->ship;
u->building = clone->building; u->building = clone->building;
u->hp = 1; u->hp = 1;
@ -262,10 +265,8 @@ destroy_unit(unit * u)
if (a!=NULL) a_remove(&clone->attribs, a); if (a!=NULL) a_remove(&clone->attribs, a);
fset(u, UFL_LONGACTION); fset(u, UFL_LONGACTION);
set_number(clone, 0); set_number(clone, 0);
u = clone; } else
zombie = false; #endif
}
if (zombie) { if (zombie) {
u_setfaction(u, findfaction(MONSTER_FACTION)); u_setfaction(u, findfaction(MONSTER_FACTION));
scale_number(u, 1); scale_number(u, 1);