Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/ship.cc')
-rw-r--r--src/game/base/ship.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 676ba65..dc039e4 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -42,6 +42,7 @@ Ship::Ship(core::Player *owner, const ShipModel *shipmodel) : core::EntityContro
ship_spawn = 0;
ship_maxarmor = 100.0f;
+ ship_armor = 0.0f;
ship_maxshield = 0.0f;
ship_shield = 0.0f;
@@ -499,7 +500,24 @@ void Ship::collision(core::Entity *other)
ship_armor = 0;
std::string message("^B");
message.append(owner()->name());
- message.append(" ^Bwent boom.");
+
+ core::Player *assassin = 0;
+
+ if (spacemine->ownerid()) {
+ assassin = core::server()->find_player(spacemine->ownerid());
+ }
+
+ if (assassin) {
+ if (assassin == owner()) {
+ message.append(" ^Bran into his own mine.");
+ } else {
+ message.append(" ^Bran into ");
+ message.append(assassin->name());
+ message.append(" ^B's mine.");
+ }
+ } else {
+ message.append(" ^Bwent boom.");
+ }
core::server()->broadcast(message);
} else {
die();
@@ -860,6 +878,9 @@ void Ship::frame(const unsigned long elapsed)
Projectile * projectile = new Projectile((*it)->lifespan());
projectile->set_damage(10.0f);
projectile->set_color(color());
+ if (owner()) {
+ projectile->set_ownerid(owner()->id());
+ }
projectile->set_zone(zone());
projectile->set_axis(axis() * (*it)->axis());
projectile->set_location(location() + (axis() * (*it)->location() * modelscale) + projectile->axis().forward() * projectile->radius());