mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 13:35:12 +00:00
Prevent some mod init related lua crashes
This commit is contained in:
parent
5fd6d685d7
commit
72c58f722e
2 changed files with 6 additions and 0 deletions
|
@ -35,6 +35,9 @@ bool first_person_check_cancels(void) {
|
|||
if (m->action == ACT_FIRST_PERSON || m->action == ACT_IN_CANNON || m->action == ACT_READING_NPC_DIALOG || m->action == ACT_DISAPPEARED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (gLuaLoadingMod != NULL) { return false; }
|
||||
|
||||
struct Object *bowser = find_object_with_behavior(bhvBowser);
|
||||
if (bowser != NULL && (bowser->oAction == 5 || bowser->oAction == 6)) {
|
||||
return true;
|
||||
|
|
|
@ -11,6 +11,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 on mod init, this can cause issues if --server is specificed
|
||||
if (gLuaLoadingMod != NULL) { return NULL; }
|
||||
|
||||
if (doSync) {
|
||||
// prevent spawning objects before area is synchronized
|
||||
if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { return NULL; }
|
||||
|
|
Loading…
Reference in a new issue