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-11-01 13:33:18 +0000
committerStijn Buys <ingar@osirion.org>2008-11-01 13:33:18 +0000
commit83d6c17799c4d448a67ab5cdad02954282fa5c94 (patch)
tree2d76abb9bb501491f78e07822ed52e8302fdd247 /src/game/base
parenta6bceed80f1b4315f23656efeceb6fe02cc7641c (diff)
server-side model loading, initial @dock function
Diffstat (limited to 'src/game/base')
-rw-r--r--src/game/base/base.cc17
-rw-r--r--src/game/base/ship.cc7
2 files changed, 20 insertions, 4 deletions
diff --git a/src/game/base/base.cc b/src/game/base/base.cc
index 738db04..6a3738e 100644
--- a/src/game/base/base.cc
+++ b/src/game/base/base.cc
@@ -159,6 +159,18 @@ void func_impulse(core::Player *player, std::string const &args)
ship->impulse();
}
+/// a player sends a docking request
+void func_dock(core::Player *player,core::Entity *entity)
+{
+ if (!player->control())
+ return;
+
+ if (player->control()->zone() != entity->zone())
+ return;
+
+ core::server()->send(player, "^BSending docking request to " + entity->name() + "^B...");
+}
+
/* -- class Base static members ----------------------------------- */
// game variables
@@ -211,6 +223,9 @@ void Base::init()
func = core::Func::add("buy", (core::GameFuncPtr) func_buy);
func->set_info("buy a ship");
+ func = core::Func::add("@dock", (core::TargetFuncPtr) func_dock);
+ func->set_info("send a docking request");
+
func = core::Func::add("jump", (core::GameFuncPtr) func_jump);
func->set_info("[string] activate or deactivate hyperspace jump drive");
@@ -389,7 +404,7 @@ bool Base::load_zone(core::Zone *zone)
} else if (zoneini.got_section("entity")) {
entity = new core::Entity();
- entity->entity_flags += core::Entity::Static;
+ entity->set_flag(core::Entity::Static);
entity->set_zone(zone);
count ++;
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 574d66c..412668d 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -26,9 +26,9 @@ const float MIN_DELTA = 0.000001f;
Ship::Ship(core::Player *owner, ShipModel *shipmodel) :
core::EntityControlable(owner, ship_enttype)
{
- entity_modelname = "ships/" + shipmodel->modelname();
- entity_name = shipmodel->name() + ": <^B" + owner->name() + "^N>";
- entity_label = shipmodel->label();
+ set_modelname("ships/" + shipmodel->modelname());
+ set_name(shipmodel->name() + ": <^B" + owner->name() + "^N>");
+ set_label(shipmodel->label());
entity_moduletypeid = ship_enttype;
@@ -266,6 +266,7 @@ void Ship::frame(float seconds)
entity_dirty = true;
// FIXME 5 second cooldown
+ entity_speed = Base::g_impulsespeed->value();
entity_eventstate = core::Entity::Normal;
} else if (entity_eventstate == core::Entity::ImpulseInitiate) {