File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 99#include " zEntCruiseBubble.h"
1010#include " zGameState.h"
1111#include " xScrFx.h"
12+ #include " zSaveLoad.h"
1213
1314#include < types.h>
1415#include < rwplcore.h>
@@ -881,6 +882,45 @@ namespace oob_state
881882 } // namespace
882883} // namespace oob_state
883884
885+ U8 oob_state::update (xScene& scene, F32 dt)
886+ {
887+ if ((shared.flags & 0x3 ) != 0x3 )
888+ {
889+ return FALSE ;
890+ }
891+
892+ if (zSaveLoadGetPreAutoSave ())
893+ {
894+ return FALSE ;
895+ }
896+
897+ if (oob_player_teleported)
898+ {
899+ shared.flags &= ~0x8 ;
900+ }
901+
902+ if ((shared.flags & 0x8 ) && !(globals.player .ControlOff & 0x8000 ))
903+ {
904+ force_start ();
905+ }
906+
907+ while (true )
908+ {
909+ state_enum newtype = shared.state ->update (scene, dt);
910+ if (newtype == shared.state ->type )
911+ {
912+ break ;
913+ }
914+
915+ shared.state ->stop ();
916+ shared.state = shared.states [newtype];
917+ shared.state ->start ();
918+ }
919+
920+
921+ return shared.control ;
922+ }
923+
884924bool oob_state::IsPlayerInControl ()
885925{
886926 return oob_state::shared.control == 0 ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ extern bool oob_player_teleported;
1111
1212namespace oob_state
1313{
14+ U8 update (xScene& scene, F32 dt);
1415 bool render ();
1516 void fx_render ();
1617 void force_start ();
You can’t perform that action at this time.
0 commit comments