mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Prevent spawning objects from lua before the area is synchronized
This commit is contained in:
parent
99c4498236
commit
1c7451fcfc
2 changed files with 4 additions and 1 deletions
|
@ -146,7 +146,7 @@ void print_intro_text(void) {
|
|||
|
||||
u32 get_mario_spawn_type(struct Object *o) {
|
||||
if (o == NULL) { return 0; }
|
||||
|
||||
|
||||
const BehaviorScript *behavior = virtual_to_segmented(0x13, o->behavior);
|
||||
|
||||
for (s32 i = 0; i < 20; i++) {
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
#include "pc/debuglog.h"
|
||||
|
||||
static struct Object* spawn_object_internal(enum BehaviorId behaviorId, enum ModelExtendedId modelId, f32 x, f32 y, f32 z, LuaFunction objSetupFunction, bool doSync) {
|
||||
// prevent spawning objects before area is synchronized
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return NULL; }
|
||||
|
||||
const BehaviorScript* behavior = get_behavior_from_id(behaviorId);
|
||||
if (behavior == NULL) {
|
||||
LOG_ERROR("failed to find behavior %u", behaviorId);
|
||||
|
|
Loading…
Reference in a new issue