Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-24 21:36:39 +0000
committerStijn Buys <ingar@osirion.org>2008-08-24 21:36:39 +0000
commite6272cd7d356bbb047dcaebb03ae217235e1e13f (patch)
tree7c7c6551a2d7051d10b0c4f0c4d87554365c63de /src/core/entity.cc
parent9c4d134ab304794b755139e90ca6da9de73a1e9a (diff)
afterburner/reverse/strafe
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 04ede71..99462b8 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -376,6 +376,8 @@ EntityControlable::EntityControlable(Player *owner, unsigned int flags) :
target_thrust = 0.0f;
target_pitch = 0.0f;
target_roll = 0.0f;
+ target_strafe = 0.0f;
+ target_afterburner = 0.0f;
entity_owner = 0;
if (owner)
@@ -391,6 +393,8 @@ EntityControlable::EntityControlable(std::istream & is) :
target_thrust = 0.0f;
target_pitch = 0.0f;
target_roll = 0.0f;
+ target_strafe = 0.0f;
+ target_afterburner = 0.0f;
entity_owner = 0;
}
@@ -429,6 +433,8 @@ void EntityControlable::serialize_client_update(std::ostream & os) const
os << target_pitch << " ";
os << target_thrust << " ";
os << target_roll << " ";
+ os << target_strafe << " ";
+ os << target_afterburner << " ";
}
void EntityControlable::receive_client_update(std::istream &is)
@@ -438,6 +444,8 @@ void EntityControlable::receive_client_update(std::istream &is)
is >> target_pitch;
is >> target_thrust;
is >> target_roll;
+ is >> target_strafe;
+ is >> target_afterburner;
}
void EntityControlable::serialize_server_update(std::ostream & os) const
@@ -505,6 +513,28 @@ void EntityControlable::set_roll(float roll)
}
}
+void EntityControlable::set_strafe(float strafe)
+{
+ if ((flags() & Static) == Static)
+ return;
+
+ if (target_strafe != strafe) {
+ target_strafe = strafe;
+ entity_dirty = true;
+ }
+}
+
+void EntityControlable::set_afterburner(float afterburner)
+{
+ if ((flags() & Static) == Static)
+ return;
+
+ if (target_afterburner != afterburner) {
+ target_afterburner = afterburner;
+ entity_dirty = true;
+ }
+}
+
/*----- EntityGlobe ------------------------------------------------ */
EntityGlobe::EntityGlobe(unsigned int flags) :