summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/field_map_obj.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/field_map_obj.c b/src/field_map_obj.c
index bbdaaf6ec..b85432e69 100644
--- a/src/field_map_obj.c
+++ b/src/field_map_obj.c
@@ -782,7 +782,7 @@ static void RemoveFieldObjectIfOutsideView(struct MapObject *mapObject)
right = gSaveBlock1Ptr->pos.x + 17;
top = gSaveBlock1Ptr->pos.y;
bottom = gSaveBlock1Ptr->pos.y + 16;
-
+
if (mapObject->coords2.x >= left && mapObject->coords2.x <= right
&& mapObject->coords2.y >= top && mapObject->coords2.y <= bottom)
return;
@@ -943,3 +943,13 @@ void FieldObjectSetGraphicsId(struct MapObject *mapObject, u8 graphicsId)
CameraObjectReset1();
}
}
+
+void unref_sub_808E504(u8 localId, u8 mapNum, u8 mapGroup, u8 graphicsId)
+{
+ u8 mapObjectId;
+
+ if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId))
+ {
+ FieldObjectSetGraphicsId(&gMapObjects[mapObjectId], graphicsId);
+ }
+}