From 2aba6b4976cd81ea1af2af6d8adb77072cd3e0be Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 10 Jan 2015 23:30:08 +0000 Subject: Print a message if the player tries to beam cargo and the cargo hold is full. --- src/game/base/game.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/game/base') diff --git a/src/game/base/game.cc b/src/game/base/game.cc index 315f1fa..d7f8435 100644 --- a/src/game/base/game.cc +++ b/src/game/base/game.cc @@ -1532,6 +1532,7 @@ void Game::func_beam(core::Player *player, const std::string &args) core::Zone *zone = player->control()->zone(); core::Inventory *inventory = player->control()->inventory(); + bool cargo_hold_full = false; // entity iterator for (core::Zone::Content::iterator eit = zone->content().begin(); eit != zone->content().end(); eit++) { @@ -1584,9 +1585,16 @@ void Game::func_beam(core::Player *player, const std::string &args) // if there's no loot left, the cargo pod will be destroyed if (!loot_left) { (*eit)->die(); + } else { + cargo_hold_full = true; } } } + + if (cargo_hold_full) + { + player->send("^WNot enough cargo space available!"); + } } // launch request -- cgit v1.2.3