From 7d7b9324f1f0db14648fb9fe32256d7942af77b9 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 16 Mar 2008 14:51:37 +0000 Subject: somewhat smoother network play, player assets, client pif updates --- src/core/entity.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/core/entity.cc') 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; -- cgit v1.2.3