1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fixed #849. Fixed buying artifacts for free.

Minor tweaks.
This commit is contained in:
DjWarmonger 2012-01-28 11:42:15 +00:00
parent 855cebfe81
commit 56c56f81e3
3 changed files with 16 additions and 19 deletions

View File

@ -2883,12 +2883,18 @@ void CMarketplaceWindow::makeDeal()
return;
int leftIdToSend = -1;
if(mode == EMarketMode::CREATURE_RESOURCE)
leftIdToSend = hLeft->serial;
else if(mode == EMarketMode::ARTIFACT_RESOURCE)
leftIdToSend = hLeft->getArtInstance()->id;
else
leftIdToSend = hLeft->id;
switch (mode)
{
case EMarketMode::CREATURE_RESOURCE:
leftIdToSend = hLeft->serial;
break;
case EMarketMode::ARTIFACT_RESOURCE:
leftIdToSend = hLeft->getArtInstance()->id;
break;
default:
leftIdToSend = hLeft->id;
break;
}
if(slider)
{

View File

@ -428,11 +428,7 @@
"level": 7,
"name": [ "LesserTitan" ],
"faction": 2,
"ability_add": [ [ "SPELL_IMMUNITY", 0, 62, 0 ], //giants are immune to mind spells (blind)
[ "SPELL_IMMUNITY", 0, 61, 0 ], //giants are immune to mind spells (forgetfulness)
[ "SPELL_IMMUNITY", 0, 60, 0 ], //giants are immune to mind spells (hypnotize)
[ "SPELL_IMMUNITY", 0, 59, 0 ], //giants are immune to mind spells (berserk)
[ "SPELL_IMMUNITY", 0, 50, 0 ] ], //giants are immune to mind spells (sorrow)
"ability_add": [ ["MIND_IMMUNITY", 0, 0, 0] ], //giants are immune to mind spells
"upgrade": 41,
"defname": "CLTITA.DEF"
},
@ -442,11 +438,7 @@
"level": 7,
"name": [ "GreaterTitan" ],
"faction": 2,
"ability_add": [ [ "SPELL_IMMUNITY", 0, 62, 0 ], //titans are immune to mind spells (blind)
[ "SPELL_IMMUNITY", 0, 61, 0 ], //titans are immune to mind spells (forgetfulness)
[ "SPELL_IMMUNITY", 0, 60, 0 ], //titans are immune to mind spells (hypnotize)
[ "SPELL_IMMUNITY", 0, 59, 0 ], //titans are immune to mind spells (berserk)
[ "SPELL_IMMUNITY", 0, 50, 0 ], //titans are immune to mind spells (sorrow)
"ability_add": [ ["MIND_IMMUNITY", 0, 0, 0], //Titans are immune to mind spells
[ "HATE", 50, 83, 0 ] ], //titans hate black dragons
"defname": "CGTITA.DEF",
"projectile_defname": "CPRGTIX.DEF",

View File

@ -6816,8 +6816,7 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode::EMar
if(id1 != 6) //non-gold prices are doubled
r /= 2;
assert(g >= r); //should we allow artifacts cheaper than unit of resource?
val1 = (g / r) + 0.5;
val1 = std::max(1, (int)((g / r) + 0.5)); //don't sell arts for less than 1 resource
val2 = 1;
}
break;
@ -6831,7 +6830,7 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode::EMar
// r /= 2;
val1 = 1;
val2 = (r / g) + 0.5;
val2 = std::max(1, (int)((r / g) + 0.5)); //at least one resource is given in return
}
break;
case EMarketMode::CREATURE_EXP: