diff --git a/data/dynos_mgr_models.cpp b/data/dynos_mgr_models.cpp index 53ba9578..f357de76 100644 --- a/data/dynos_mgr_models.cpp +++ b/data/dynos_mgr_models.cpp @@ -30,8 +30,10 @@ static std::map sOverwriteMap; static u32 find_empty_id() { u32 id = 256; while (true) { - if (sIdMap.count(id) == 0) { return id; } - if (sIdMap[id].size() == 0) { return id; } + if (id != 0) { + if (sIdMap.count(id) == 0) { return id; } + if (sIdMap[id].size() == 0) { return id; } + } id++; } } diff --git a/lib/coopnet/linux/libcoopnet.a b/lib/coopnet/linux/libcoopnet.a index 8d7d5231..b5abf3e5 100644 Binary files a/lib/coopnet/linux/libcoopnet.a and b/lib/coopnet/linux/libcoopnet.a differ diff --git a/src/game/platform_displacement.c b/src/game/platform_displacement.c index 62d019c9..d33188cc 100644 --- a/src/game/platform_displacement.c +++ b/src/game/platform_displacement.c @@ -107,6 +107,7 @@ void apply_platform_displacement(u32 playerIndex, struct Object *platform) { UNUSED s16 unused2; UNUSED s16 unused3; f32 displaceMatrix[4][4]; + if (!platform) { return; } rotation[0] = platform->oAngleVelPitch; rotation[1] = platform->oAngleVelYaw; diff --git a/src/pc/crash_handler.c b/src/pc/crash_handler.c index 405db830..a1333e42 100644 --- a/src/pc/crash_handler.c +++ b/src/pc/crash_handler.c @@ -26,12 +26,14 @@ #include "pc/mods/mods.h" #include "pc/debuglog.h" +char gLastRemoteBhv[256] = ""; + typedef struct { s32 x, y; u8 r, g, b; char s[128]; } CrashHandlerText; -static CrashHandlerText sCrashHandlerText[128 + 256]; +static CrashHandlerText sCrashHandlerText[128 + 256 + 4]; #define PTR long long unsigned int)(uintptr_t @@ -636,6 +638,7 @@ static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *cont } crash_handler_add_info_str(&pText, 335, 208, "Version", get_version_local()); + crash_handler_add_info_str(&pText, 8, 208, "RemoteBhv", gLastRemoteBhv); // sounds #ifdef HAVE_SDL2 diff --git a/src/pc/crash_handler.h b/src/pc/crash_handler.h index ecf32cc8..ac916511 100644 --- a/src/pc/crash_handler.h +++ b/src/pc/crash_handler.h @@ -15,6 +15,7 @@ struct PcDebug { }; extern struct PcDebug gPcDebug; +extern char gLastRemoteBhv[]; void crash_handler_init(void); diff --git a/src/pc/network/coopnet/coopnet.c b/src/pc/network/coopnet/coopnet.c index fb4bd799..43904325 100644 --- a/src/pc/network/coopnet/coopnet.c +++ b/src/pc/network/coopnet/coopnet.c @@ -129,6 +129,7 @@ static void coopnet_on_error(enum MPacketErrorNumber error, uint64_t tag) { break; } } + static bool ns_coopnet_initialize(enum NetworkType networkType, bool reconnecting) { sNetworkType = networkType; sReconnecting = reconnecting; diff --git a/src/pc/network/packets/packet_spawn_objects.c b/src/pc/network/packets/packet_spawn_objects.c index 781de92b..b99229d3 100644 --- a/src/pc/network/packets/packet_spawn_objects.c +++ b/src/pc/network/packets/packet_spawn_objects.c @@ -6,9 +6,10 @@ #include "src/game/area.h" #include "behavior_data.h" #include "behavior_table.h" -#include "src/pc/lua/smlua.h" -#include "src/pc/lua/utils/smlua_model_utils.h" -#include "src/pc/lua/utils/smlua_obj_utils.h" +#include "pc/lua/smlua.h" +#include "pc/lua/utils/smlua_model_utils.h" +#include "pc/lua/utils/smlua_obj_utils.h" +#include "pc/crash_handler.h" //#define DISABLE_MODULE_LOG 1 #include "pc/debuglog.h" @@ -154,6 +155,7 @@ void network_receive_spawn_objects(struct Packet* p) { name = gNetworkPlayers[p->localIndex].name; } LOG_INFO("rx spawn object %s from %s (%s)", get_behavior_name_from_id(data.behaviorId), name, id); + snprintf(gLastRemoteBhv, 256, "%s %s (%s)", get_behavior_name_from_id(data.behaviorId), name, id); struct Object* parentObj = NULL; if (data.parentId == (u32)-1) {