1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Enable mine building for iron only after prospecting

It fixes the bug #68. Note that is possible to restore this funny bug
with --restore-bugs argument.
This commit is contained in:
Mathieu Schroeter 2018-07-27 00:40:31 +02:00
parent 65f80113dd
commit f155f3b635
2 changed files with 12 additions and 6 deletions

View File

@ -197,6 +197,7 @@ CDecor::Init (Sint32 channel, Sint32 icon)
m_decor[x][y].rankMove = -1;
m_decor[x][y].workBlupi = -1;
m_decor[x][y].fire = 0;
m_decor[x][y].flagged = false;
}
}
@ -403,6 +404,10 @@ CDecor::PutObject (Point cel, Sint32 channel, Sint32 icon)
m_decor[cel.x / 2][cel.y / 2].objectChannel = channel;
m_decor[cel.x / 2][cel.y / 2].objectIcon = icon;
/* When flagged, it's possible to build a mine for iron */
if (icon == 124)
m_decor[cel.x / 2][cel.y / 2].flagged = true;
SubDrapeau (cel); // on pourra de nouveau planter un drapeau
return true;
@ -1835,13 +1840,13 @@ CDecor::CelOkForAction (
}
}
if (action == EV_ACTION_BUILD4) // mine ?
GetFloor (cel, channel, icon);
if ( // mine ?
action == EV_ACTION_BUILD4 &&
((!g_restoreBugs && !m_decor[cel.x / 2][cel.y / 2].flagged) || // fixed
(g_restoreBugs && (channel != CHFLOOR || icon != 71)))) // funny bug
{
GetFloor (cel, channel, icon);
if (channel != CHFLOOR || icon != 71) // terre à fer ?
{
error = Errors::GROUND; // sol pas adéquat
}
error = Errors::GROUND; // sol pas adéquat
}
if (

View File

@ -48,6 +48,7 @@ typedef struct {
Sint16 rankMove; // rang dans m_move
Sint16 workBlupi; // rang du blupi travaillant ici
Sint16 fire;
Sint8 flagged;
} Cellule;
// Cette structure doit être la plus petite possible, car
// il en existe un tableau de 100x100 = 10'000 cellules !