Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
12 stars 5 forks source link

MobIdle.gd:35 @ Physics_Update(): Parameter "map" is null. #326

Closed snipercup closed 1 month ago

snipercup commented 2 months ago

Sometimes this bug happens:

E 0:05:38:0540   MobIdle.gd:35 @ Physics_Update(): Parameter "map" is null.
  <C++ Source>   modules/navigation/godot_navigation_server.cpp:1169 @ _query_path()
  <Stack Trace>  MobIdle.gd:35 @ Physics_Update()
                 StateMachine.gd:29 @ _physics_process()

This will occur when you leave a mob behind and it starts it's idle movement. Let's say it's at the south edge of the chunk and you're walking north. The chunks south of the mobs will be unloaded. Now, while the mob is still on the chunk that's not unloaded yet, it will idly move to the unloaded chunk and cross it's boundary.

We could mitigate this by restricting the mob to it's own chunk while in idle mode.