autounlock:untrap
Implement 'untrap' as an 'autounlock' action. Quite a bit more work than anticipated. The new documentation is rather clumsy; too many if-this and if-not-that clauses have intruded. I'll be astonished if all the return values are correct.... [A couple of places were checking for (rx != 0 && ry != 0) to decide whether they were performating an autounlock action at <rx,ry> but that erroneously excludes the top line of the map if the current level extends that far. Just check rx for zero/non-zero.]
This commit is contained in:
@@ -1720,7 +1720,7 @@ arti_invoke(struct obj *obj)
|
||||
break;
|
||||
}
|
||||
case UNTRAP: {
|
||||
if (!untrap(TRUE)) {
|
||||
if (!untrap(TRUE, 0, 0, (struct obj *) 0)) {
|
||||
obj->age = 0; /* don't charge for changing their mind */
|
||||
return ECMD_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user