diff options
author | Stijn Buys <ingar@osirion.org> | 2008-03-16 14:51:37 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-03-16 14:51:37 +0000 |
commit | 7d7b9324f1f0db14648fb9fe32256d7942af77b9 (patch) | |
tree | ef2a60c275f22c6b1ab7430a299138597030b581 /src/core/entity.cc | |
parent | 9a7ca1743f0c74042bca4d4903f7e56fe810edce (diff) |
somewhat smoother network play, player assets, client pif updates
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index 36868af..d64ae61 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -199,6 +199,9 @@ EntityDynamic::~EntityDynamic() void EntityDynamic::frame(float seconds) { + if ((flags() & Static) == Static) + return; + if (entity_speed == 0) return; @@ -239,7 +242,9 @@ void EntityDynamic::recieve_server_update(std::istream &is) EntityControlable::EntityControlable(Player *player, unsigned int flags) : EntityDynamic(flags) { - entity_owner = 0; + entity_owner = player; + if (entity_owner) + entity_owner->add_asset(this); entity_thrust = 0; target_direction = 0.0f; @@ -261,6 +266,8 @@ EntityControlable::EntityControlable(std::istream & is) : EntityControlable::~EntityControlable() { + if (entity_owner) + entity_owner->remove_asset(this); } void EntityControlable::serialize(std::ostream & os) const @@ -306,6 +313,9 @@ void EntityControlable::frame(float seconds) void EntityControlable::set_thrust(float thrust) { + if ((flags() & Static) == Static) + return; + if (!(thrust == target_thrust)) { target_thrust = thrust; entity_dirty = true; @@ -314,6 +324,9 @@ void EntityControlable::set_thrust(float thrust) void EntityControlable::set_direction(float direction) { + if ((flags() & Static) == Static) + return; + if (!(target_direction == direction)) { target_direction = direction; entity_dirty = true; |