1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Added workaround for a const value treated by gcc -O0 as a regular variable, and thus preventing linking.

This commit is contained in:
Frank Zago 2009-08-08 05:45:00 +00:00
parent 425791f27e
commit bf17a77e00

View File

@ -1670,7 +1670,8 @@ void CRecruitmentWindow::clickLeft(tribool down)
int curx = 192 + 51 - (CREATURE_WIDTH*creatures.size()/2) - (SPACE_BETWEEN*(creatures.size()-1)/2);
for(int i=0;i<creatures.size();i++)
{
if(isItIn(&genRect(132,CREATURE_WIDTH,pos.x+curx,pos.y+64),GH.current->motion.x,GH.current->motion.y))
const int sCREATURE_WIDTH = CREATURE_WIDTH; // gcc -O0 workaround
if(isItIn(&genRect(132,sCREATURE_WIDTH,pos.x+curx,pos.y+64),GH.current->motion.x,GH.current->motion.y))
{
which = i;
int newAmount = std::min(amounts[i],creatures[i].amount);
@ -1700,7 +1701,8 @@ void CRecruitmentWindow::clickRight( boost::logic::tribool down )
int curx = 192 + 51 - (CREATURE_WIDTH*creatures.size()/2) - (SPACE_BETWEEN*(creatures.size()-1)/2);
for(int i=0;i<creatures.size();i++)
{
if(isItIn(&genRect(132,CREATURE_WIDTH,pos.x+curx,pos.y+64),GH.current->motion.x,GH.current->motion.y))
const int sCREATURE_WIDTH = CREATURE_WIDTH; // gcc -O0 workaround
if(isItIn(&genRect(132,sCREATURE_WIDTH,pos.x+curx,pos.y+64),GH.current->motion.x,GH.current->motion.y))
{
CCreInfoWindow *popup = new CCreInfoWindow(creatures[i].ID, 0, 0, NULL, NULL, NULL, NULL);
GH.pushInt(popup);