diff options
author | Stijn Buys <ingar@osirion.org> | 2012-11-11 20:56:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-11-11 20:56:30 +0000 |
commit | 7bec374404aa1a0b30c220aee49b4a9890437f75 (patch) | |
tree | 8800c5623039b59bd781d4310e0c9c966e3b2b8e /src/game | |
parent | 89d8f7f384dcd6c201288bf6fe86ab19e59e1a5c (diff) |
Cleaned up core::EntyControlable client-side and server-side proprties API.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/base/ship.cc | 10 | ||||
-rw-r--r-- | src/game/intro/convoy.cc | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc index 22fb269..22725e0 100644 --- a/src/game/base/ship.cc +++ b/src/game/base/ship.cc @@ -485,7 +485,8 @@ void Ship::frame(const unsigned long elapsed) entity_thrust = 0; entity_speed = 0.0f; - + entity_controlflags = 0; + } else if (entity_state == core::Entity::JumpInitiate) { if (ship_jumpdrive_timer + 1.0f <= core::server()->time()) { @@ -533,6 +534,8 @@ void Ship::frame(const unsigned long elapsed) target_afterburner = 0.0f; target_thrust = 0.1f; + + entity_controlflags = 0; } else if (entity_state == core::Entity::Jump) { @@ -545,6 +548,8 @@ void Ship::frame(const unsigned long elapsed) target_afterburner = 0.0f; target_thrust = 0.0f; + + entity_controlflags = 0; // apply jump drive cooldown if (ship_jumpdrive_timer + 1.0f <= core::server()->time()) { @@ -623,6 +628,8 @@ void Ship::frame(const unsigned long elapsed) math::clamp(target_roll, -1.0f, 1.0f); math::clamp(target_direction, -1.0f, 1.0f); math::clamp(target_afterburner, -1.0f, 1.0f); + + entity_controlflags = target_controlflags; } else if (entity_state == core::Entity::Destroyed) { @@ -637,6 +644,7 @@ void Ship::frame(const unsigned long elapsed) target_thrust = 0; entity_thrust = 0; + entity_controlflags = 0; } /* -- SNAPPY ------------------------------------------ */ diff --git a/src/game/intro/convoy.cc b/src/game/intro/convoy.cc index 8a436bb..47f997c 100644 --- a/src/game/intro/convoy.cc +++ b/src/game/intro/convoy.cc @@ -23,7 +23,7 @@ Member::Member(std::string const &modelname) : core::EntityControlable() set_radius(model()->radius()); } - entity_thrust = 1.0f; + set_thrust(1.0f); } Member::~Member() @@ -69,7 +69,7 @@ void Convoy::add(const std::string &modelname) member->get_color().assign(color()); member->get_color_second().assign(color_second()); - member->entity_thrust = 1.0f; + member->set_thrust(1.0f); member->set_speed(speed()); member->get_location().assign(location()); |