PFQNiet / Satisfactorio

Factorio mod that brings Satisfactory mechanics
GNU General Public License v3.0
11 stars 2 forks source link

Editor Pet [ERROR] #86

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug Pet crash the game if player become invalid in multiplayer game

To Reproduce Steps to reproduce the behavior:

  1. have a friend join your game
  2. your friend tame a pet
  3. /admin and delete your friend player

Expected behavior No Crash

Screenshots

Error message

Error while running event Satisfactorio::on_ai_command_completed (ID 117)
LuaPlayer API call when LuaPlayer was invalid.
stack traceback:
    [C]: in function '__index'
    __Satisfactorio__/scripts/creatures/lizard-doggo.lua:207: in function 'howFarIsMyOwner'
    __Satisfactorio__/scripts/creatures/lizard-doggo.lua:250: in function 'handler'
    __core__/lualib/event_handler.lua:47: in function <__core__/lualib/event_handler.lua:45>

Additional info Not an issue for normal game

PFQNiet commented 2 years ago

Deleting a player may cause issues elsewhere too. If you come across any, please let me know so I can add further checks for that.