unref_sub_808E504

This commit is contained in:
PikalaxALT
2017-09-07 21:17:55 -04:00
parent a87b35f9a7
commit ad99377734
3 changed files with 12 additions and 35 deletions

View File

@@ -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);
}
}