[CF-Devel] Strange problem, possible related to new attack fixes (hit player)
Peter Mardahl
peterm at tesla.EECS.Berkeley.EDU
Thu Nov 23 18:52:38 CST 2000
I noticed a problem where a SPLINT object from a bomb hit a player
and was removed apparently by hit_player, and then another removal
attempt was made by check_fired_arch.
I checked in a "fix" for this problem, but I think the bug is
actually somewhere else than I "fixed" it.
See the function below:
void check_fired_arch (object *op)
{
tag_t op_tag = op->count, tmp_tag;
object *tmp;
int dam;
if ( ! blocked (op->map, op->x, op->y))
return;
if (op->other_arch) {
explode_object (op);
return;
}
for (tmp = get_map_ob (op->map,op->x,op->y); tmp != NULL; tmp = tmp->above)
{
if (QUERY_FLAG (tmp, FLAG_ALIVE)) {
tmp_tag = tmp->count;
dam = hit_player (tmp, op->stats.dam, op, op->attacktype);
if (was_destroyed (op, op_tag) || ! was_destroyed (tmp, tmp_tag)
|| (op->stats.dam -= dam) < 0)
{
if(!QUERY_FLAG(op,FLAG_REMOVED)) { /* line ADDED */
remove_ob (op);
free_object(op);
return;
}
} /* line ADDED */
}
}
}
cvs server: Diffing .
Index: spell_util.c
===================================================================
RCS file: /home/cvs/CVS/crossfire/server/spell_util.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -c -r1.33 -r1.34
*** spell_util.c 2000/11/21 18:58:34 1.33
--- spell_util.c 2000/11/24 00:48:56 1.34
***************
*** 1,6 ****
/*
* static char *rcsid_spell_util_c =
! * "$Id: spell_util.c,v 1.33 2000/11/21 18:58:34 peterm Exp $";
*/
/*
--- 1,6 ----
/*
* static char *rcsid_spell_util_c =
! * "$Id: spell_util.c,v 1.34 2000/11/24 00:48:56 peterm Exp $";
*/
/*
***************
*** 1720,1728 ****
--- 1720,1730 ----
if (was_destroyed (op, op_tag) || ! was_destroyed (tmp, tmp_tag)
|| (op->stats.dam -= dam) < 0)
{
+ if(!QUERY_FLAG(op,FLAG_REMOVED)) {
remove_ob (op);
free_object(op);
return;
+ }
}
}
}
More information about the crossfire
mailing list