forkserf / forkserf

a continuation of "FreeSerf"

Home Page:https://forkserf.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

consider increasing the size of the Inventory resource out-queue

tlongstretch opened this issue · comments

Inventory::Inventory(Game *game, unsigned int index)
: GameObject(game, index)
, owner(0)
, flag(0)
, building(0)
, out_queue{}
, serfs_out(0)
, generic_count(0)
, res_dir(0) {
// is increasing the out_queue size as simple as increasing this? what effects might that have?
for (int i = 0; i < 2; i++) {
out_queue[i].type = Resource::TypeNone;
out_queue[i].dest = 0;
}
}

Inventory::~Inventory() {
for (int i = 0; i < 2 && out_queue[i].type != Resource::TypeNone; i++) {
Resource::Type res = out_queue[i].type;
int dest = out_queue[i].dest;

game->cancel_transported_resource(res, dest);
game->lose_resource(res);

}

game->add_gold_total(-static_cast(resources[Resource::TypeGoldBar]));
game->add_gold_total(-static_cast(resources[Resource::TypeGoldOre]));
}