cmann1 / dustmod-issues

Dustmod issue tracker
0 stars 0 forks source link

Crash when hitting a quill with an `on_hit_callback` #64

Closed AlexMorson closed 2 years ago

AlexMorson commented 2 years ago

On the dev build, version 21.9.1 linux64 steam, with this script:

class script : callback_base
{
    void on_level_start() { controller_controllable(0).on_hit_callback(this, "on_hit", 0); }
    void on_hit(controllable@, controllable@, hitbox@, int) {}
}

Hitting a quill results in the following crash:

exception: Null pointer access
  void entity_hittable::invoke_hit_callbacks(hit_box_controller@) C:/GOG Games/Dustforce DX/content_src/scripts/source/entities/entity_hittable.hpp:231
  void entity_hittable::hit(hit_box_controller@) C:/GOG Games/Dustforce DX/content_src/scripts/source/entities/entity_hittable.hpp:240
  void base_projectile::hit(hit_box_controller@) C:/GOG Games/Dustforce DX/content_src/scripts/source/entities/base_projectile.hpp:167
  void hit_box_controller::trigger_hb() C:/GOG Games/Dustforce DX/content_src/scripts/source/entities/hit_box_controller.hpp:363
  void hit_box_controller::step() C:/GOG Games/Dustforce DX/content_src/scripts/source/entities/hit_box_controller.hpp:161
  void world::sub_step(bool, bool, int) C:/GOG Games/Dustforce DX/content_src/scripts/source/world.hpp:206
  void game::step_world(bool, bool, int) C:/GOG Games/Dustforce DX/content_src/scripts/source/game.hpp:562
  void game::simulate(int, bool = false) C:/GOG Games/Dustforce DX/content_src/scripts/source/game.hpp:891
  void game::simulate_base(int) C:/GOG Games/Dustforce DX/content_src/scripts/source/game.hpp:1362
  void main() C:/GOG Games/Dustforce DX/content_src/scripts/source/main.cpp:1713
Script Error!