Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: Dread Crash



> 
> 	I think my crash is related to this line in spell_effect.c in
> fire_cancellation():
> 
> 	int fire_cancellation(object *op,int dir,archetype *at, int magic) {
> 	  object *tmp;
> 	  if(at==NULL)
> 	    return 0;
> 	  tmp=arch_to_object(at);
> 	  if(tmp==NULL)
> 	    return 0;
> 	  tmp->x=op->x,tmp->y=op->y;
> 	  tmp->direction=dir;
> 	  if(magic)
> 	    tmp->attacktype|=AT_MAGIC;
> 	  set_owner(tmp,op);
> ==>	  if(op->type==PLAYER)
> 	  insert_ob_in_map(tmp,op->map);
> 	  move_cancellation(tmp);
> 	  return 1;
> 	}
> 
> Does anyone know why this condition is there?  I think the later problems
> come from trying to move the cancellation object when it hasn't been
> inserted into a map.

I don't know why that condition is there, but I agree, it's BAD.
If it doesn't put the cancellation in the map, it should destroy it.

What does cancellation DO anyway?

Anyway, either the if statement should be nuked, or it should
be changed to:

if(op->type==PLAYER) {
	insert_ob_in_map(tmp,op->map);
	move_cancellation(tmp);
	}
else
	free_ob(tmp);

(or something similar which works.)

PeterM


-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]