mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #157 from Pax1601/156-delete-lua-function-can-cause-player-desync-in-multiplayer
updated Olympus.delete to avoid player desync
This commit is contained in:
commit
cae9b16d97
@ -341,8 +341,13 @@ function Olympus.delete(ID, lat, lng)
|
||||
Olympus.debug("Olympus.delete " .. ID, 2)
|
||||
local unit = Olympus.getUnitByID(ID)
|
||||
if unit then
|
||||
unit:destroy();
|
||||
Olympus.debug("Olympus.delete completed successfully", 2)
|
||||
if unit:getPlayerName() then
|
||||
trigger.action.explosion(unit:getPoint() , 250 ) --consider replacing with forcibly deslotting the player, however this will work for now
|
||||
Olympus.debug("Olympus.delete completed successfully", 2)
|
||||
else
|
||||
unit:destroy(); --works for AI units not players
|
||||
Olympus.debug("Olympus.delete completed successfully", 2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user