diff options
| author | Ritabrata Das <[email protected]> | 2025-03-03 14:41:24 +0530 |
|---|---|---|
| committer | Ritabrata Das <[email protected]> | 2025-03-03 14:41:24 +0530 |
| commit | 4c59fc24b86fda2e317f4fce77eea7a11ff87e30 (patch) | |
| tree | 0a37d56b443a9ddfbb397bedec27f37bfd795b45 /plugins | |
| parent | aa558bb5e8542ef8ba5e723d78cc7db0899d35c6 (diff) | |
Fix crash on ground plugin, add additional logging, fix readback packet
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/crash_on_ground.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/crash_on_ground.py b/plugins/crash_on_ground.py index 935ace3..fb9d080 100644 --- a/plugins/crash_on_ground.py +++ b/plugins/crash_on_ground.py @@ -1,5 +1,6 @@ # This plugin renders the dead plane until crashes in ground # Thus disabling mid air dispawning when dead +from lib.PacketManager.packets import FSNETCMD_REMOVEAIRPLANE, FSNETCMD_READBACK ENABLED = True @@ -9,7 +10,16 @@ class Plugin: def register(self, plugin_manager): self.plugin_manager = plugin_manager - self.plugin_manager.register_hook('on_unjoin', self.on_death) + #self.plugin_manager.register_hook('on_unjoin', self.on_death) + self.plugin_manager.register_hook('on_remove_airplane_server', self.on_death) def on_death(self, data, player, message_to_client, message_to_server): - return False + if player.aircraft.id != -1: + if player.aircraft.id == FSNETCMD_REMOVEAIRPLANE(data).object_id: + return True + else: + a = FSNETCMD_READBACK.encode(2, player.aircraft.id, True) + message_to_server.append(a) + return False + else: + return True |
