move validations before their first use
This commit is contained in:
+3
-1
@@ -2085,7 +2085,7 @@ is_rottable(struct obj *otmp)
|
|||||||
void
|
void
|
||||||
place_object(struct obj *otmp, int x, int y)
|
place_object(struct obj *otmp, int x, int y)
|
||||||
{
|
{
|
||||||
register struct obj *otmp2 = g.level.objects[x][y];
|
register struct obj *otmp2;
|
||||||
|
|
||||||
if (!isok(x, y)) { /* validate location */
|
if (!isok(x, y)) { /* validate location */
|
||||||
void (*func)(const char *, ...) PRINTF_F(1, 2);
|
void (*func)(const char *, ...) PRINTF_F(1, 2);
|
||||||
@@ -2099,6 +2099,8 @@ place_object(struct obj *otmp, int x, int y)
|
|||||||
panic("place_object: obj \"%s\" [%d] not free",
|
panic("place_object: obj \"%s\" [%d] not free",
|
||||||
safe_typename(otmp->otyp), otmp->where);
|
safe_typename(otmp->otyp), otmp->where);
|
||||||
|
|
||||||
|
otmp2 = g.level.objects[x][y];
|
||||||
|
|
||||||
obj_no_longer_held(otmp);
|
obj_no_longer_held(otmp);
|
||||||
if (otmp->otyp == BOULDER) {
|
if (otmp->otyp == BOULDER) {
|
||||||
if (!otmp2 || otmp2->otyp != BOULDER)
|
if (!otmp2 || otmp2->otyp != BOULDER)
|
||||||
|
|||||||
Reference in New Issue
Block a user