Re: #U800: possible bug regarding pits

<email deleted> wrote:
> Not sure what exactly should occur, but this seems funny: If
> you escape a pit and there is an object in the pit, you can
> not reach it to pick it up. Nor can you go down into the pit
> to get it, but sitting gives the message "you sit on the
> (object) it's not very comfortable. How can the character sit
> on it if it's in the bottom of the pit?
This commit is contained in:
nethack.allison
2003-12-16 02:58:55 +00:00
parent a4a80fdbca
commit 28934bc7b6
2 changed files with 9 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ fix "You hear The food ration tumbles downwards" for blinded pit dropping
silver arrows weren't causing silver damage on some silver-haters when wielded
wizard mode: avoid division by 0 crash for level teleport in the endgame if
confusion overrides teleport control
don't #sit on an object in a pit if you're only on the precipice
Platform- and/or Interface-Specific Fixes

View File

@@ -39,7 +39,7 @@ int
dosit()
{
static const char sit_message[] = "sit on the %s.";
register struct trap *trap;
register struct trap *trap = t_at(u.ux,u.uy);
register int typ = levl[u.ux][u.uy].typ;
@@ -63,7 +63,11 @@ dosit()
goto in_water;
}
if(OBJ_AT(u.ux, u.uy)) {
if (OBJ_AT(u.ux, u.uy) &&
/* ensure we're not standing on the precipice */
!((!u.utrap || u.utraptype != TT_PIT) &&
(trap && trap->tseen &&
(trap->ttyp==PIT || trap->ttyp==SPIKED_PIT)))) {
register struct obj *obj;
obj = level.objects[u.ux][u.uy];
@@ -71,7 +75,7 @@ dosit()
if (!(Is_box(obj) || objects[obj->otyp].oc_material == CLOTH))
pline("It's not very comfortable...");
} else if ((trap = t_at(u.ux, u.uy)) != 0 ||
} else if (trap != 0 ||
(u.utrap && (u.utraptype >= TT_LAVA))) {
if (u.utrap) {
@@ -80,7 +84,7 @@ dosit()
You_cant("sit down with your %s in the bear trap.", body_part(FOOT));
u.utrap++;
} else if(u.utraptype == TT_PIT) {
if(trap->ttyp == SPIKED_PIT) {
if(trap && trap->ttyp == SPIKED_PIT) {
You("sit down on a spike. Ouch!");
losehp(Half_physical_damage ? rn2(2) : 1,
"sitting on an iron spike", KILLED_BY);