diff options
author | Stijn Buys <ingar@osirion.org> | 2010-10-26 21:08:12 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-10-26 21:08:12 +0000 |
commit | 75c6db097b990e58b4b2585580a89561c838d923 (patch) | |
tree | 8c913bdc531ea9a76dcaa9e10a65763f95fa55e4 /src/core/entity.cc | |
parent | 23c7d2c11170ee8736673e82a88e87a3d2e538f7 (diff) |
updated network protocol version to 20, implemented invemtory depletion, unified depletion with keepalive
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r-- | src/core/entity.cc | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc index c99c186..4f13efa 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -160,6 +160,7 @@ Entity::Entity() : entity_created = true; entity_destroyed = false; entity_dirty = false; + entity_keepalive = 0; entity_zone = 0; entity_oldzone = 0; @@ -182,6 +183,7 @@ Entity::Entity(std::istream & is) entity_zone = 0; entity_oldzone = 0; entity_visible = true; + entity_keepalive = 0; entity_model = 0; @@ -471,6 +473,10 @@ void Entity::frame(float seconds) { } +void Entity::upkeep(const unsigned long timestamp) +{ +} + void Entity::add_menu(MenuDescription *menu) { entity_menus.push_back(menu); @@ -544,16 +550,12 @@ EntityDynamic::EntityDynamic() : Entity() { entity_state = Normal; entity_timer = 0; - entity_keepalive_time = 0.0f; - entity_keepalive_timeout = 0.0f; } EntityDynamic::EntityDynamic(std::istream & is) : Entity(is) { entity_state = Normal; entity_timer = 0; - entity_keepalive_time = 0.0f; - entity_keepalive_timeout = 0.0f; } EntityDynamic::~EntityDynamic() @@ -568,16 +570,6 @@ void EntityDynamic::set_state(int state) } } -void EntityDynamic::set_keepalive_time(float time) -{ - entity_keepalive_time = time; -} - -void EntityDynamic::set_keepalive_timeout(float timeout) -{ - entity_keepalive_timeout = timeout; -} - void EntityDynamic::reset() { Entity::reset(); @@ -596,13 +588,7 @@ void EntityDynamic::frame(float seconds) if (entity_state == Docked) { return; } - - if (flag_is_set(KeepAlive)) { - if ((keepalive_time() > 0.0f) && (keepalive_time() < server()->time())) { - die(); - } - } - + // transfer bullet state to entity state if (entity_body) { // this makes sure an update is sent if speed goes to 0 in the next step @@ -822,6 +808,7 @@ void EntityControlable::serialize_client_update(std::ostream & os) const os << target_thrust << " "; os << target_roll << " "; os << target_strafe << " "; + os << target_vstrafe << " "; os << target_afterburner << " "; } @@ -833,6 +820,7 @@ void EntityControlable::receive_client_update(std::istream &is) is >> target_thrust; is >> target_roll; is >> target_strafe; + is >> target_vstrafe; is >> target_afterburner; } |