diff options
Diffstat (limited to 'src/game/example')
-rw-r--r-- | src/game/example/spectator.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/game/example/spectator.cc b/src/game/example/spectator.cc index 93c6fdd..defc356 100644 --- a/src/game/example/spectator.cc +++ b/src/game/example/spectator.cc @@ -12,15 +12,18 @@ namespace example core::Cvar *Spectator::g_spectatorspeed = 0; core::Cvar *Spectator::g_spectatorrotation = 0; -Spectator::Spectator(core::Player *owner) : core::EntityControlable(owner) +Spectator::Spectator(core::Player *owner) : core::EntityControlable() { // default properties entity_shape = core::Entity::Diamond; set_radius(0.25f); // the spectator gets player color - get_color().assign(owner->color()); - get_color_second().assign(owner->color_second()); + if (owner) { + set_owner(owner); + get_color().assign(owner->color()); + get_color_second().assign(owner->color_second()); + } // set dirty flag set_dirty(); |