diff --git a/src/decor.cxx b/src/decor.cxx index 9985376..b972a3f 100644 --- a/src/decor.cxx +++ b/src/decor.cxx @@ -1864,6 +1864,9 @@ Errors CDecor::CelOkForAction ( error = Errors::MISC; // pas assez fort } + if (m_blupi[rank].energy <= MAXENERGY / 2) + error = Errors::ENERGY; // not enough energy + GetObject (cel, channel, icon); if (channel != CHOBJECT || icon != 44) // pierres ? { @@ -1916,6 +1919,9 @@ Errors CDecor::CelOkForAction ( error = Errors::MISC; // pas assez fort } + if (m_blupi[rank].energy <= MAXENERGY / 2) + error = Errors::ENERGY; // not enough energy + GetObject (cel, channel, icon); if (channel != CHOBJECT || icon != 44) // pierres ? { diff --git a/src/def.h b/src/def.h index b0e5e57..6d8663b 100644 --- a/src/def.h +++ b/src/def.h @@ -367,6 +367,7 @@ enum Errors { TOURISOL = 6, TOUREAU = 7, TELE2 = 8, + ENERGY = 9, REPEAT = 500, }; diff --git a/src/menu.cxx b/src/menu.cxx index 90d7647..9ad7e5d 100644 --- a/src/menu.cxx +++ b/src/menu.cxx @@ -125,7 +125,7 @@ static const char * GetErr (Sint32 rank) translate ("Occupied ground"), translate ("Opposite bank no good"), translate ("Bridge finished"), translate ("(isolated tower)"), translate ("Too close to water"), translate ("Already two teleporters"), - }; + translate ("Not enough energy")}; return gettext (list[rank]); }