Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-11-15 15:35:59 +0000
committerStijn Buys <ingar@osirion.org>2009-11-15 15:35:59 +0000
commit7888930bf0a75999e103f7781c095e04b6860ee5 (patch)
tree5e42e818366181590fedc15e06548b1e463265e7 /src/game
parent89c0bc88bd4ebdc44dfb99235609c90e968af533 (diff)
added entity request network message
Diffstat (limited to 'src/game')
-rw-r--r--src/game/base/jumppoint.cc4
-rw-r--r--src/game/base/navpoint.cc8
-rw-r--r--src/game/base/planet.cc4
-rw-r--r--src/game/base/ship.cc27
-rw-r--r--src/game/base/star.cc5
-rw-r--r--src/game/example/spectator.cc9
-rw-r--r--src/game/intro/convoy.cc5
7 files changed, 39 insertions, 23 deletions
diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc
index 270275f..9ef18d9 100644
--- a/src/game/base/jumppoint.cc
+++ b/src/game/base/jumppoint.cc
@@ -12,12 +12,14 @@ namespace game
/* ---- class JumpPoint -------------------------------------------- */
-JumpPoint::JumpPoint() : core::EntityDynamic(core::Entity::Bright)
+JumpPoint::JumpPoint() : core::EntityDynamic()
{
entity_shape = core::Entity::Diamond;
get_color().assign(0.0f, 0.8f, 0.8f, 1.0f);
get_color_second().assign(0.6f, 1.0f);
set_radius(0.25f);
+ set_flag(core::Entity::Static);
+ set_flag(core::Entity::Bright);
entity_moduletypeid = jumppoint_enttype;
jumppoint_target = 0;
diff --git a/src/game/base/navpoint.cc b/src/game/base/navpoint.cc
index 78f1ae0..7d0d75c 100644
--- a/src/game/base/navpoint.cc
+++ b/src/game/base/navpoint.cc
@@ -10,14 +10,16 @@
namespace game
{
-NavPoint::NavPoint() : core::Entity(core::Entity::Static | core::Entity::Bright)
+NavPoint::NavPoint() : core::Entity()
{
- //set_flag(core::Entity::ShowOnMap);
entity_shape = core::Entity::Diamond;
get_color().assign(1.0f, 1.0f);
get_color_second().assign(0.6f, 1.0f);
set_radius(0.25f);
-
+ set_flag(core::Entity::Static);
+ set_flag(core::Entity::Bright);
+ //set_flag(core::Entity::ShowOnMap);
+
entity_moduletypeid = navpoint_enttype;
}
diff --git a/src/game/base/planet.cc b/src/game/base/planet.cc
index f9535ba..380ca02 100644
--- a/src/game/base/planet.cc
+++ b/src/game/base/planet.cc
@@ -11,9 +11,11 @@
namespace game
{
-Planet::Planet() : core::EntityGlobe(core::Entity::Static | core::Entity::Solid)
+Planet::Planet() : core::EntityGlobe()
{
set_flag(core::Entity::ShowOnMap);
+ set_flag(core::Entity::Static);
+ set_flag(core::Entity::Solid);
get_color().assign(1.0f, 1.0f); // white
set_radius(64.0f); // 64 game units
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index f2bd703..6aaba40 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -24,29 +24,30 @@ namespace game
const float MIN_DELTA = 0.000001f;
-Ship::Ship(core::Player *owner, ShipModel *shipmodel) :
- core::EntityControlable(owner, ship_enttype),
- PhysicsBody(this)
+Ship::Ship(core::Player *owner, ShipModel *shipmodel) : core::EntityControlable(), PhysicsBody(this)
{
+ entity_moduletypeid = ship_enttype;
+
set_modelname(shipmodel->modelname());
set_name(shipmodel->name());
set_info(shipmodel);
- std::string str(aux::text_strip(owner->name()));
- aux::to_label(str);
- set_label(str);
-
- entity_moduletypeid = ship_enttype;
-
- get_color().assign(owner->color());
- get_color_second().assign(owner->color_second());
-
ship_shipmodel = shipmodel;
ship_jumpdrive = shipmodel->jumpdrive();
-
ship_impulsedrive_timer = 0;
ship_jumpdrive_timer = 0;
ship_jumpdepart = 0;
+
+ if (owner) {
+ set_owner(owner);
+ get_color().assign(owner->color());
+ get_color_second().assign(owner->color_second());
+ std::string str(aux::text_strip(owner->name()));
+ aux::to_label(str);
+ set_label(str);
+ } else {
+ set_label(shipmodel->label());
+ }
reset();
}
diff --git a/src/game/base/star.cc b/src/game/base/star.cc
index 43efd0c..21fa4af 100644
--- a/src/game/base/star.cc
+++ b/src/game/base/star.cc
@@ -11,9 +11,12 @@
namespace game
{
-Star::Star() : core::EntityGlobe(core::Entity::Static | core::Entity::Solid | core::Entity::Bright)
+Star::Star() : core::EntityGlobe()
{
set_flag(core::Entity::ShowOnMap);
+ set_flag(core::Entity::Static);
+ set_flag(core::Entity::Solid);
+ set_flag(core::Entity::Bright);
get_color().assign(1.0f, 1.0f);
get_color_second().assign(1.0f, 1.0f);
diff --git a/src/game/example/spectator.cc b/src/game/example/spectator.cc
index 93c6fdd..defc356 100644
--- a/src/game/example/spectator.cc
+++ b/src/game/example/spectator.cc
@@ -12,15 +12,18 @@ namespace example
core::Cvar *Spectator::g_spectatorspeed = 0;
core::Cvar *Spectator::g_spectatorrotation = 0;
-Spectator::Spectator(core::Player *owner) : core::EntityControlable(owner)
+Spectator::Spectator(core::Player *owner) : core::EntityControlable()
{
// default properties
entity_shape = core::Entity::Diamond;
set_radius(0.25f);
// the spectator gets player color
- get_color().assign(owner->color());
- get_color_second().assign(owner->color_second());
+ if (owner) {
+ set_owner(owner);
+ get_color().assign(owner->color());
+ get_color_second().assign(owner->color_second());
+ }
// set dirty flag
set_dirty();
diff --git a/src/game/intro/convoy.cc b/src/game/intro/convoy.cc
index 413e377..b037b0b 100644
--- a/src/game/intro/convoy.cc
+++ b/src/game/intro/convoy.cc
@@ -12,8 +12,9 @@ namespace intro
/* ---- class Member ----------------------------------------------- */
-Member::Member(std::string const &model) : core::EntityControlable(0, 1)
+Member::Member(std::string const &model) : core::EntityControlable()
{
+ entity_moduletypeid = 1;
set_name("Convoy ship");
set_label("ship");
@@ -35,6 +36,8 @@ void Member::frame(float seconds)
Convoy::Convoy(core::Zone *zone) : core::EntityDynamic()
{
+ entity_moduletypeid = 2;
+
set_zone(zone);
set_label("convoy");
set_name("Convoy");