Fix segfault when tripping over something
If you tripped over something, and there were no rocks on that place, the otmp object variable was set to null but used later for checking if it was a corpse.
This commit is contained in:
+3
-3
@@ -692,7 +692,7 @@ struct obj *figurine;
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
slip_or_trip()
|
slip_or_trip()
|
||||||
{
|
{
|
||||||
struct obj *otmp = vobj_at(u.ux, u.uy);
|
struct obj *otmp = vobj_at(u.ux, u.uy), *otmp2;
|
||||||
const char *what;
|
const char *what;
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
boolean on_foot = TRUE;
|
boolean on_foot = TRUE;
|
||||||
@@ -716,9 +716,9 @@ slip_or_trip()
|
|||||||
: "them")
|
: "them")
|
||||||
: (otmp->dknown || !Blind)
|
: (otmp->dknown || !Blind)
|
||||||
? doname(otmp)
|
? doname(otmp)
|
||||||
: ((otmp = sobj_at(ROCK, u.ux, u.uy)) == 0
|
: ((otmp2 = sobj_at(ROCK, u.ux, u.uy)) == 0
|
||||||
? something
|
? something
|
||||||
: (otmp->quan == 1L ? "a rock" : "some rocks"));
|
: (otmp2->quan == 1L ? "a rock" : "some rocks"));
|
||||||
if (Hallucination) {
|
if (Hallucination) {
|
||||||
what = strcpy(buf, what);
|
what = strcpy(buf, what);
|
||||||
buf[0] = highc(buf[0]);
|
buf[0] = highc(buf[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user