mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fixed crash in network_receive_lua_custom()
This commit is contained in:
parent
e914a4e2c4
commit
3a807bee06
1 changed files with 10 additions and 0 deletions
|
|
@ -11,6 +11,11 @@ void network_send_lua_custom(bool broadcast) {
|
||||||
u16 zero = 0;
|
u16 zero = 0;
|
||||||
s32 paramIndex = 1;
|
s32 paramIndex = 1;
|
||||||
|
|
||||||
|
if (!L) {
|
||||||
|
LOG_ERROR("Sent lua custom packet when lua is dead");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// figure out mod index
|
// figure out mod index
|
||||||
if (gLuaActiveMod == NULL) {
|
if (gLuaActiveMod == NULL) {
|
||||||
LOG_LUA_LINE("Could not figure out the current active mod!");
|
LOG_LUA_LINE("Could not figure out the current active mod!");
|
||||||
|
|
@ -99,6 +104,11 @@ void network_receive_lua_custom(struct Packet* p) {
|
||||||
packet_read(p, &modIndex, sizeof(u16));
|
packet_read(p, &modIndex, sizeof(u16));
|
||||||
packet_read(p, &keyCount, sizeof(u8));
|
packet_read(p, &keyCount, sizeof(u8));
|
||||||
|
|
||||||
|
if (!L) {
|
||||||
|
LOG_ERROR("Received lua custom packet when lua is dead");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
s32 tableIndex = lua_gettop(L);
|
s32 tableIndex = lua_gettop(L);
|
||||||
for(u16 i = 0; i < keyCount; i++) {
|
for(u16 i = 0; i < keyCount; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue