boulder/statue/landmine reversal and new fix
This includes a reversal of my earlier boulder/statue/landmine fix, and places a check for obj->where==OBJ_FLOOR into fracture_rock(). I think this is a better approach because: - if eliminates the pointless extract/place in fracture_rock, followed by extract/place in the caller in the two places causing the crash - it covers any similar situations that we might have missed or that someone might add accidentally (you might not expect the location of an object to change inside fracture_rock()) - it allows fracturing to take place on the other object chains if we ever need it (statues falling down stairs, perhaps?) - it doesn't move objects from other chains onto the floor briefly as the current code does
This commit is contained in:
14
src/zap.c
14
src/zap.c
@@ -3708,12 +3708,14 @@ register struct obj *obj; /* no texts here! */
|
||||
obj->onamelth = 0; /* no names */
|
||||
obj->oxlth = 0; /* no extra data */
|
||||
obj->oattached = OATTACHED_NOTHING;
|
||||
obj_extract_self(obj); /* move rocks back on top */
|
||||
place_object(obj, obj->ox, obj->oy);
|
||||
if(!does_block(obj->ox,obj->oy,&levl[obj->ox][obj->oy]))
|
||||
unblock_point(obj->ox,obj->oy);
|
||||
if(cansee(obj->ox,obj->oy))
|
||||
newsym(obj->ox,obj->oy);
|
||||
if (obj->where == OBJ_FLOOR) {
|
||||
obj_extract_self(obj); /* move rocks back on top */
|
||||
place_object(obj, obj->ox, obj->oy);
|
||||
if(!does_block(obj->ox,obj->oy,&levl[obj->ox][obj->oy]))
|
||||
unblock_point(obj->ox,obj->oy);
|
||||
if(cansee(obj->ox,obj->oy))
|
||||
newsym(obj->ox,obj->oy);
|
||||
}
|
||||
}
|
||||
|
||||
/* handle statue hit by striking/force bolt/pick-axe */
|
||||
|
||||
Reference in New Issue
Block a user