Skip to content

Commit

Permalink
Miscellaneous fixes to banks:
Browse files Browse the repository at this point in the history
- fixed evaluation of bank thread by AI (1850)
- fixed crash on evaluating bank threat after loading from save (1830)
- fixed typo in bank config. TODO: schema?
  • Loading branch information
IvanSavenko committed Aug 9, 2014
1 parent f55d335 commit 05d8fad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
24 changes: 12 additions & 12 deletions config/objects/creatureBanks.json
Expand Up @@ -110,7 +110,7 @@
},
"dwarvenTreasury" : {
"index" : 1,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Dwarven Treasury",
"rmg" : {
"value" : 2000,
Expand Down Expand Up @@ -197,7 +197,7 @@
},
"griffinConservatory" : {
"index" : 2,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Griffin Conservatory",
"rmg" : {
"value" : 2000,
Expand Down Expand Up @@ -268,7 +268,7 @@
},
"inpCache" : {
"index" : 3,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Imp Cache",
"rmg" : {
"value" : 5000,
Expand Down Expand Up @@ -354,7 +354,7 @@
},
"medusaStore" : {
"index" : 4,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Medusa Stores",
"rmg" : {
"value" : 1500,
Expand Down Expand Up @@ -441,7 +441,7 @@
},
"nagaBank" : {
"index" : 5,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Naga Bank",
"rmg" : {
"value" : 3000,
Expand Down Expand Up @@ -528,7 +528,7 @@
},
"dragonflyHive" : {
"index" : 6,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Dragon Fly Hive",
"rmg" : {
"value" : 9000,
Expand Down Expand Up @@ -605,7 +605,7 @@
"types" : {
"shipwreck" : {
"index" : 0,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Shipwreck",
"rmg" : {
"value" : 2000,
Expand Down Expand Up @@ -696,7 +696,7 @@
"types" : {
"derelictShip" : {
"index" : 0,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Derelict Ship",
"rmg" : {
"value" : 4000,
Expand Down Expand Up @@ -788,7 +788,7 @@
"types" : {
"crypt" : {
"index" : 0,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Crypt",
"rmg" : {
"value" : 1000,
Expand Down Expand Up @@ -877,7 +877,7 @@
"types" : {
"dragonUtopia" : {
"index" : 0,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Dragon Utopia",
"rmg" : {
"value" : 10000,
Expand Down Expand Up @@ -986,7 +986,7 @@
"types" : {
"pyramid" : {
"index" : 0,
"resetDuraition" : 28,
"resetDuration" : 28,
"name" : "Pyramid",
"rmg" : {
"value" : 5000,
Expand All @@ -1011,4 +1011,4 @@
}
}
}
}
}
1 change: 1 addition & 0 deletions lib/mapObjects/CommonConstructors.cpp
Expand Up @@ -303,6 +303,7 @@ void CBankInstanceConstructor::configureObject(CGObjectInstance * object, CRando
CBankInfo::CBankInfo(JsonVector config):
config(config)
{
assert(!config.empty());
}

static void addStackToArmy(IObjectInfo::CArmyStructure & army, const CCreature * crea, si32 amount)
Expand Down
6 changes: 6 additions & 0 deletions lib/mapObjects/CommonConstructors.h
Expand Up @@ -184,4 +184,10 @@ class CBankInstanceConstructor : public CDefaultObjectTypeHandler<CBank>
void configureObject(CGObjectInstance * object, CRandomGenerator & rng) const;

std::unique_ptr<IObjectInfo> getObjectInfo(ObjectTemplate tmpl) const;

template <typename Handler> void serialize(Handler &h, const int version)
{
h & levels & bankResetDuration;
h & static_cast<CDefaultObjectTypeHandler<CBank>&>(*this);
}
};
1 change: 1 addition & 0 deletions lib/mapObjects/JsonRandom.cpp
Expand Up @@ -202,6 +202,7 @@ namespace JsonRandom
for (auto creaID : crea->upgrades)
info.allowedCreatures.push_back(VLC->creh->creatures[creaID]);
}
ret.push_back(info);
}
return ret;
}
Expand Down

0 comments on commit 05d8fad

Please sign in to comment.