From e7061d6fed8bdfc1828315eb8745cd919cb96bbc Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 22 Dec 2014 16:57:20 +0000 Subject: Prevent wingmen from getting destroyed when you buy a new ship or use the 'give ship' engine command. --- src/game/base/npc.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/game/base/npc.h') diff --git a/src/game/base/npc.h b/src/game/base/npc.h index 39395c0..411f807 100644 --- a/src/game/base/npc.h +++ b/src/game/base/npc.h @@ -31,7 +31,7 @@ public: /* ---- inspectors ----------------------------------------- */ /** - * @brief returns the general moode of the NPC + * @brief returns the general mood of the NPC * */ inline const Mood mood() const { @@ -39,7 +39,7 @@ public: } /** - * @brief returns this NPC's leader. + * @brief returns this NPC's leader * */ inline Ship *leader() { @@ -47,13 +47,21 @@ public: } /** - * @brief returns this NPC's patrol. + * @brief returns this NPC's patrol * */ inline Patrol *patrol() { return npc_patrol; } + /** + * @brief return this NPC;s fleet commander + * */ + inline core::Player *commander() + { + return npc_commander; + } + /* ---- mutators ------------------------------------------- */ /** @@ -71,6 +79,11 @@ public: * */ void set_patrol(Patrol *patrol); + /** + * @brief set the NPC's fleet commander + * */ + void set_commander(core::Player *player); + /** * @brief game frame * */ @@ -103,6 +116,8 @@ private: float npc_weapon_range; + core::Player *npc_commander; + }; // class NPC } // namespace game -- cgit v1.2.3