mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
fixed adding player to chunk crash
This commit is contained in:
parent
9c032a3167
commit
64078e5e84
@ -5,6 +5,7 @@ Date: 17. 12. 2021
|
||||
- Added RTStasisRealm to surface exclusion list
|
||||
Bugfixes:
|
||||
- Fixed onBuilderArrived if the builder was a unit and not a group (Thanks DBotThePony for reporting)
|
||||
- Fixed adding player to chunk crash
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 2.0.3
|
||||
|
@ -451,11 +451,10 @@ function chunkPropertyUtils.decayDeathGenerator(map, chunk)
|
||||
end
|
||||
|
||||
function chunkPropertyUtils.addPlayerToChunk(map, chunk, name)
|
||||
local playerChunks = map.playerToChunk
|
||||
local playerCountChunks = map.chunkToPlayerCount
|
||||
local playerChunk = playerChunks[name]
|
||||
local playerChunk = map.playerToChunk[name]
|
||||
if not playerChunk then
|
||||
playerChunks[name] = chunk
|
||||
map.playerToChunk[name] = chunk
|
||||
local playerCount = playerCountChunks[chunk.id]
|
||||
if not playerCount then
|
||||
playerCountChunks[chunk.id] = 1
|
||||
@ -463,9 +462,11 @@ function chunkPropertyUtils.addPlayerToChunk(map, chunk, name)
|
||||
playerCountChunks[chunk.id] = playerCount + 1
|
||||
end
|
||||
elseif (playerChunk.id ~= chunk.id) then
|
||||
playerChunks[name] = chunk
|
||||
map.playerToChunk[name] = chunk
|
||||
local playerCount = playerCountChunks[playerChunk.id]
|
||||
chunkPropertyUtils.setPlayersOnChunk(map, playerChunk, playerCount - 1)
|
||||
if playerCount then
|
||||
chunkPropertyUtils.setPlayersOnChunk(map, playerChunk, playerCount - 1)
|
||||
end
|
||||
playerCount = playerCountChunks[chunk.id]
|
||||
if not playerCount then
|
||||
playerCountChunks[chunk.id] = 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user