Make objects not run their code if the room they are in isn't loaded. (#502)
This commit is contained in:
1 parent
d7d0364682
commit
ab94fd7f63
5 files changed
+21
-7
No files matched your search
@@ -820,6 +820,15 @@ void cur_obj_update(void) {
|
||||
BhvCommandProc bhvCmdProc;
|
||||
s32 bhvProcResult;
|
||||
|
||||
if (!(objFlags & OBJ_FLAG_PROCESS_OUTSIDE_ROOM)) {
|
||||
if (o->oRoom != -1 && gMarioCurrentRoom != 0 && !is_room_loaded()) {
|
||||
cur_obj_disable_rendering();
|
||||
o->activeFlags |= ACTIVE_FLAG_IN_DIFFERENT_ROOM;
|
||||
gNumRoomedObjectsNotInMarioRoom++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the distance from the object to Mario.
|
||||
if (objFlags & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) {
|
||||
o->oDistanceToMario = dist_between_objects(o, gMarioObject);
|
||||
|
||||
Reference in new issue
Block a user