Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-04 15:14:42 +0000
committerStijn Buys <ingar@osirion.org>2010-10-04 15:14:42 +0000
commit81acfb7cd3ced1e613acaf45b44867e56b137dc9 (patch)
treee49aad9f368cfd7e6f7f13e80c9774b13f1f6238 /src
parent5141df01c1a12cd325fc0100b5ad1547d5ee0c8b (diff)
corrected a crashbug, added cargo listing for give cargo
Diffstat (limited to 'src')
-rw-r--r--src/game/base/cargo.cc5
-rw-r--r--src/game/base/cargo.h2
-rw-r--r--src/game/base/game.cc2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/game/base/cargo.cc b/src/game/base/cargo.cc
index 626a1b3..668c3a4 100644
--- a/src/game/base/cargo.cc
+++ b/src/game/base/cargo.cc
@@ -294,5 +294,10 @@ void Cargo::buy(core::EntityControlable *buyer, core::Entity *seller, const int
buyer->owner()->sound("game/buy");
}
+void Cargo::list()
+{
+ core::Info::list(cargo_infotype);
+}
+
} // namespace game
diff --git a/src/game/base/cargo.h b/src/game/base/cargo.h
index 1e97d40..25b8739 100644
--- a/src/game/base/cargo.h
+++ b/src/game/base/cargo.h
@@ -27,6 +27,8 @@ public:
static Cargo *find(const std::string & label);
static bool init();
+
+ static void list();
};
} // namespace game
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index c6b45ad..a3d9899 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -315,7 +315,7 @@ void Game::func_give(core::Player *player, const std::string &args)
item = new core::Item(cargo);
player->control()->inventory()->add(item);
} else {
- assert(player->control()->info() == cargo);
+ assert(item->info() == cargo);
}
item->inc_amount(amount);
player->control()->inventory()->set_dirty();