Haywire::Haywire(const Reader& reader) :
WalkingBadguy(reader, "images/creatures/haywire/haywire.sprite", "left", "right"),
is_exploding(false),
- is_stunned(false)
+ time_until_explosion(0.0f),
+ is_stunned(false),
+ time_stunned(0.0f)
{
walk_speed = 80;
max_drop_height = 16;
Haywire::Haywire(const Vector& pos, Direction d) :
WalkingBadguy(pos, d, "images/creatures/haywire/haywire.sprite", "left", "right"),
is_exploding(false),
- is_stunned(false)
+ time_until_explosion(0.0f),
+ is_stunned(false),
+ time_stunned(0.0f)
{
walk_speed = 80;
max_drop_height = 16;
}
if (is_stunned) {
- player->bounce (*this);
+ if (player)
+ player->bounce (*this);
return true;
}
time_stunned = TIME_STUNNED;
is_stunned = true;
- player->bounce (*this);
+ if (player)
+ player->bounce (*this);
+
return true;
}
}
if (is_exploding && !turn_around_timer.started()) {
- Player *p = Sector::current()->get_nearest_player (this->get_bbox ());
+ Player *p = this->get_nearest_player ();
if (p) {
Direction player_dir = LEFT;