corrected supply icon rendering when using the supply button

This commit is contained in:
devZoGok
2025-04-19 16:18:07 +03:00
parent 50c5f7842d
commit 13d1e8fcbd
+10 -3
View File
@@ -193,7 +193,7 @@ namespace battleship{
cursorState = CursorState::SUPPLY;
}
else if(gameObjUnit && !ownGameObj)
else if(gameObjUnit && !(ownGameObj || alliedGameObj))
cursorState = CursorState::ATTACK;
else
cursorState = CursorState::NORMAL;
@@ -201,8 +201,15 @@ namespace battleship{
else{
if(cursorState == CursorState::GARRISON)
orderPossible = (ownGameObj && gameObjTransport && canGarrison);
else if(cursorState == CursorState::SUPPLY)
orderPossible = (roverSelected && (ownExtractor));
else if(cursorState == CursorState::SUPPLY){
bool canLoad = (rover->calcTotalLoad() < rover->getCapacity());
bool transfer = (
(refinery && ((ownGameObj && canLoad) || (alliedGameObj && sellRefs && rover->getLoad((int)ResourceType::REFINEDS) > 0))) ||
(tradeCenter && ((ownGameObj && canLoad) || (alliedGameObj && sellWealth && rover->getLoad((int)ResourceType::WEALTH) > 0))) ||
(lab && ((ownGameObj && canLoad) || (alliedGameObj && sellTech && rover->getLoad((int)ResourceType::RESEARCH) > 0)))
);
orderPossible = (roverSelected && (ownExtractor || transfer));
}
else if(cursorState == CursorState::HACK)
orderPossible = (!ownGameObj && gameObjUnit && mainPlayer->getSelectedUnit(0)->getUnitClass() == UnitClass::ENGINEER);
else if(gameObjUnit)