diff --git a/src/pc/network/packets/packet_level_spawn_info.c b/src/pc/network/packets/packet_level_spawn_info.c index e73c6aae..d2b2e6f2 100644 --- a/src/pc/network/packets/packet_level_spawn_info.c +++ b/src/pc/network/packets/packet_level_spawn_info.c @@ -107,6 +107,10 @@ void network_receive_level_spawn_info(struct Packet* p) { packet_read(p, &spawnInfoDeletionCount, sizeof(u8)); LOG_INFO("rx spawn info (count %d)", spawnInfoDeletionCount); if (spawnInfoDeletionCount <= 0) { return; } + if (thisAreaIndex >= MAX_AREAS) { + LOG_ERROR("Receiving 'location response' with invalid areaIndex!"); + return; + } struct SpawnInfo* spawnInfo = gAreaData[thisAreaIndex].objectSpawnInfos; u16 spawnInfoIndex = 0;