mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-24 09:11:43 +00:00
properly implement gamemode change, make gamemode3 (spectator) work
This commit is contained in:
parent
5a7eae3b1d
commit
3134633a87
1 changed files with 9 additions and 3 deletions
|
|
@ -83,11 +83,18 @@ function inject(serv,player)
|
||||||
|
|
||||||
player.setGameMode = gameMode =>
|
player.setGameMode = gameMode =>
|
||||||
{
|
{
|
||||||
|
player.gameMode=gameMode;
|
||||||
player._client.write('game_state_change', {
|
player._client.write('game_state_change', {
|
||||||
reason: 3,
|
reason: 3,
|
||||||
gameMode: gameMode
|
gameMode: player.gameMode
|
||||||
|
});
|
||||||
|
serv._writeAll('player_info',{
|
||||||
|
action: 1,
|
||||||
|
data: [{
|
||||||
|
UUID: player._client.uuid,
|
||||||
|
gamemode: player.gameMode
|
||||||
|
}]
|
||||||
});
|
});
|
||||||
player.gameMode=gameMode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function fillTabList()
|
function fillTabList()
|
||||||
|
|
@ -165,7 +172,6 @@ function inject(serv,player)
|
||||||
|
|
||||||
|
|
||||||
updateTime();
|
updateTime();
|
||||||
player.setGameMode(player.gameMode);
|
|
||||||
fillTabList();
|
fillTabList();
|
||||||
player.updateAndSpawnNearbyPlayers();
|
player.updateAndSpawnNearbyPlayers();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue