1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

fixed mantiss 0002254

This commit is contained in:
AlexVinS 2015-09-04 18:08:25 +03:00
parent 1510f1f14c
commit e82dfb5a85
6 changed files with 15 additions and 11 deletions

View File

@ -186,7 +186,7 @@ public:
void giveCreatures(const CArmedInstance * objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override {};
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override {};
bool changeStackType(const StackLocation &sl, CCreature *c) override {return false;};
bool changeStackType(const StackLocation &sl, const CCreature *c) override {return false;};
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override {return false;};
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;};
bool eraseStack(const StackLocation &sl, bool forceRemoval = false){return false;};

View File

@ -864,7 +864,10 @@ public:
WALKING_DEAD = 58,
WIGHTS = 60,
LICHES = 64,
BONE_DRAGON = 68,
TROGLODYTES = 70,
HYDRA = 110,
CHAOS_HYDRA = 111,
AIR_ELEMENTAL = 112,
EARTH_ELEMENTAL = 113,
FIRE_ELEMENTAL = 114,

View File

@ -61,7 +61,7 @@ public:
virtual void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) =0;
virtual void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) =0;
virtual bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) =0;
virtual bool changeStackType(const StackLocation &sl, CCreature *c) =0;
virtual bool changeStackType(const StackLocation &sl, const CCreature *c) =0;
virtual bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count = -1) =0; //count -1 => moves whole stack
virtual bool eraseStack(const StackLocation &sl, bool forceRemoval = false) =0;
virtual bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) =0;

View File

@ -795,7 +795,7 @@ struct ChangeStackCount : CGarrisonOperationPack //521
struct SetStackType : CGarrisonOperationPack //522
{
StackLocation sl;
CCreature *type;
const CCreature *type;
void applyCl(CClient *cl);
DLL_LINKAGE void applyGs(CGameState *gs);

View File

@ -2789,7 +2789,7 @@ bool CGameHandler::upgradeCreature( ObjectInstanceID objid, SlotID pos, Creature
return true;
}
bool CGameHandler::changeStackType(const StackLocation &sl, CCreature *c)
bool CGameHandler::changeStackType(const StackLocation &sl, const CCreature *c)
{
if(!sl.army->hasStackAtSlot(sl.slot))
COMPLAIN_RET("Cannot find a stack to change type");
@ -3208,14 +3208,15 @@ bool CGameHandler::transformInUndead(const IMarket *market, const CGHeroInstance
const CStackInstance &s = army->getStack(slot);
int resCreature;//resulting creature - bone dragons or skeletons
if (s.hasBonusOfType(Bonus::DRAGON_NATURE))
resCreature = 68;
else
resCreature = 56;
//resulting creature - bone dragons or skeletons
CreatureID resCreature = CreatureID::SKELETON;
changeStackType(StackLocation(army, slot), VLC->creh->creatures.at(resCreature));
if(s.hasBonusOfType(Bonus::DRAGON_NATURE)
|| (s.getCreatureID() == CreatureID::HYDRA)
|| (s.getCreatureID() == CreatureID::CHAOS_HYDRA))
resCreature = CreatureID::BONE_DRAGON;
changeStackType(StackLocation(army, slot), resCreature.toCreature());
return true;
}

View File

@ -142,7 +142,7 @@ public:
void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override;
void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures) override;
bool changeStackType(const StackLocation &sl, CCreature *c) override;
bool changeStackType(const StackLocation &sl, const CCreature *c) override;
bool changeStackCount(const StackLocation &sl, TQuantity count, bool absoluteValue = false) override;
bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override;
bool eraseStack(const StackLocation &sl, bool forceRemoval = false) override;