From 617c137a8d51173ea35b0fb7c4c78f361eb834ac Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 14:27:13 +0300 Subject: [PATCH 1/6] made the game over screens nicer --- Assets/Scripts/Gui/defeat.lua | 24 ++++++++++++---------- Assets/Scripts/Gui/statistics.lua | 33 ++++++++++++++++++------------- Assets/Scripts/Gui/victory.lua | 28 ++++++++++++++------------ game.cpp | 5 +---- map.cpp | 5 ++++- statsButton.cpp | 11 +++++++---- 6 files changed, 60 insertions(+), 46 deletions(-) diff --git a/Assets/Scripts/Gui/defeat.lua b/Assets/Scripts/Gui/defeat.lua index 3501d63..a73a62c 100644 --- a/Assets/Scripts/Gui/defeat.lua +++ b/Assets/Scripts/Gui/defeat.lua @@ -1,17 +1,22 @@ -Size = {x = 150, y = 40} - music = { loop = true, shuffle = false, delay = 2000, tracks = {'defeat.ogg'} } + +res = graphics.resolution +overlaySize = {x = 600, y = 450} +overlayPos = {x = .5 * (res.x - overlaySize.x), y = 200, z = 0} +buttonSize = {x = 150, y = 40} +buttonInitPos = {x = .5 * (res.x - buttonSize.x), y = 350, z = .1} + gui = { { guiType = GuiType.TEXT, text = 'Defeat', name = 'D', - pos = {x = 100, y = 100, z = 0}, + pos = {x = overlayPos.x + 20, y = overlayPos.y + 75, z = .1}, scale = 1, font = 'batang.ttf', fontFirstChar = 0, @@ -20,17 +25,16 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 100, y = 200, z = .1}, - size = {x = 600, y = 600}, + pos = overlayPos, + size = overlaySize, color = {x = 0, y = 0, z = 0, w = 0.1} }, { - pos = {x = 110, y = 350, z = 0}, - size = Size, + pos = buttonInitPos, + size = buttonSize, guiType = GuiType.BUTTON, name = 'Leave', buttonType = ButtonType.STATISTICS, - trigger = -1, - --imagePath = '' - } + trigger = -1 + }, } diff --git a/Assets/Scripts/Gui/statistics.lua b/Assets/Scripts/Gui/statistics.lua index 7ea7126..346e552 100644 --- a/Assets/Scripts/Gui/statistics.lua +++ b/Assets/Scripts/Gui/statistics.lua @@ -1,3 +1,8 @@ +headerHeight = 150 +statsInitHeight = 120 +statsSpace = 100 +fontName = 'batang.ttf' + gui = { { guiType = GuiType.TEXT, @@ -6,7 +11,7 @@ gui = { pos = {x = 850, y = 100, z = 0}, zIndex = 0, scale = 0.5, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -15,10 +20,10 @@ gui = { guiType = GuiType.TEXT, text = 'Player', name = 'pl', - pos = {x = 50, y = 200, z = 0}, + pos = {x = 50, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -27,10 +32,10 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles built', name = 'vb', - pos = {x = 150, y = 200, z = 0}, + pos = {x = 150, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -39,10 +44,10 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles destroyed', name = 'vd', - pos = {x = 450, y = 200, z = 0}, + pos = {x = 450, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -51,10 +56,10 @@ gui = { guiType = GuiType.TEXT, text = 'Vehicles lost', name = 'vl', - pos = {x = 850, y = 200, z = 0}, + pos = {x = 850, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -63,10 +68,10 @@ gui = { guiType = GuiType.TEXT, text = 'Structures built', name = 'sb', - pos = {x = 1050, y = 200, z = 0}, + pos = {x = 1050, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -75,10 +80,10 @@ gui = { guiType = GuiType.TEXT, text = 'Structures destroyed', name = 'sd', - pos = {x = 1350, y = 200, z = 0}, + pos = {x = 1350, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, - font = 'batang.ttf', + font = fontName, fontFirstChar = 0, fontLastChar = 256, color = {x = 1, y = 1, z = 1, w = 1} @@ -87,7 +92,7 @@ gui = { guiType = GuiType.TEXT, text = 'Structures lost', name = 'sl', - pos = {x = 1720, y = 200, z = 0}, + pos = {x = 1720, y = headerHeight, z = 0}, zIndex = 0, scale = 0.3, font = 'batang.ttf', diff --git a/Assets/Scripts/Gui/victory.lua b/Assets/Scripts/Gui/victory.lua index b249f2b..633459d 100644 --- a/Assets/Scripts/Gui/victory.lua +++ b/Assets/Scripts/Gui/victory.lua @@ -1,18 +1,22 @@ -Size = {x = 150, y = 40} - music = { loop = true, shuffle = false, delay = 2000, tracks = {'victory.ogg'} } + +res = graphics.resolution +overlaySize = {x = 600, y = 450} +overlayPos = {x = .5 * (res.x - overlaySize.x), y = 200, z = 0} +buttonSize = {x = 150, y = 40} +buttonInitPos = {x = .5 * (res.x - buttonSize.x), y = 350, z = .1} + gui = { { guiType = GuiType.TEXT, text = 'VICTORY!!!', name = 'V', - pos = {x = 100, y = 100, z = 0}, - zIndex = 0, + pos = {x = overlayPos.x + 20, y = overlayPos.y + 75, z = .1}, scale = 1, font = 'batang.ttf', fontFirstChar = 0, @@ -21,25 +25,23 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = 100, y = 200, z = 0}, - zIndex = 1, - size = {x = 600, y = 600}, + pos = overlayPos, + size = overlaySize, color = {x = 0, y = 0, z = 0, w = 0.1} }, { - pos = {x = 100, y = 350, z = 0}, - size = Size, + pos = buttonInitPos, + size = buttonSize, guiType = GuiType.BUTTON, name = 'Resume', buttonType = ButtonType.RESUME }, { - pos = {x = 110, y = 400, z = 0}, - size = Size, + pos = {x = buttonInitPos.x, y = buttonInitPos.y + buttonSize.y + 10, z = buttonInitPos.z}, + size = buttonSize, guiType = GuiType.BUTTON, name = 'Leave', buttonType = ButtonType.STATISTICS, - trigger = -1, - --imagePath = '' + trigger = -1 } } diff --git a/game.cpp b/game.cpp index 68e4ac2..15641fb 100644 --- a/game.cpp +++ b/game.cpp @@ -39,10 +39,7 @@ namespace battleship{ StateManager *sm = GameManager::getSingleton()->getStateManager(); sm->dettachAppState(sm->getAppStateByType(AppStateType::ACTIVE_STATE)); - togglePause(); - - string endGameScreen = (victory ? "victory.lua" : "defeat.lua"); - ConcreteGuiManager::getSingleton()->readLuaScreenScript(endGameScreen); + ConcreteGuiManager::getSingleton()->parseLuaScript(victory ? "victory.lua" : "defeat.lua"); } void Game::update(){ diff --git a/map.cpp b/map.cpp index b116cf3..cc59156 100755 --- a/map.cpp +++ b/map.cpp @@ -56,13 +56,16 @@ namespace battleship{ } Map::Minimap::~Minimap(){ + Node *guiNode = Root::getSingleton()->getGuiNode(); + for(Node *node : depositIcons){ - Root::getSingleton()->getGuiNode()->dettachChild(node); + guiNode->dettachChild(node); delete node; } depositIcons.clear(); + guiNode->dettachChild(camIcon); delete camIcon; } diff --git a/statsButton.cpp b/statsButton.cpp index 7e034d2..d542bb9 100644 --- a/statsButton.cpp +++ b/statsButton.cpp @@ -6,6 +6,7 @@ #include "map.h" #include +#include namespace battleship{ using namespace std; @@ -30,7 +31,9 @@ namespace battleship{ ConcreteGuiManager *guiManager = ConcreteGuiManager::getSingleton(); Vector3 plCol = player->getColor(); Root *root = Root::getSingleton(); - string fontPath = GameManager::getSingleton()->getPath() + "Fonts/batang.ttf"; + sol::state_view SOL_STATE_VIEW = generateView(); + float statsInitHeight = SOL_STATE_VIEW["statsInitHeight"], statsSpace = SOL_STATE_VIEW["statsSpace"]; + string fontName = SOL_STATE_VIEW["fontName"]; for(int i = 0; i < numPairs; i++){ Text *category = guiManager->getText(unitDataPairs[i].first); @@ -39,11 +42,11 @@ namespace battleship{ categoryMat->addBoolUniform("texturingEnabled", false); categoryMat->addVec4Uniform("diffuseColor", Vector4(plCol.x, plCol.y, plCol.z, 1)); - Text *categoryVal = new Text(fontPath, unitDataPairs[i].second); + Text *categoryVal = new Text(GameManager::getSingleton()->getPath() + "Fonts/" + fontName, unitDataPairs[i].second); categoryVal->setScale(category->getScale()); categoryVal->setMaterial(categoryMat); - Node *categoryValNode = new Node(category->getNode()->getPosition() + Vector3(0, 100 * playerId, 0)); + Node *categoryValNode = new Node(category->getNode()->getPosition() + Vector3(0, statsInitHeight + statsSpace * playerId, 0)); categoryValNode->addText(categoryVal); root->getGuiNode()->attachChild(categoryValNode); @@ -64,7 +67,7 @@ namespace battleship{ Game *game = Game::getSingleton(); int numPlayers = game->getNumPlayers(); - for(int i = 1; i < numPlayers; i++) + for(int i = 0; i < numPlayers; i++) addPlayerDataGuiElements(i); game->removeAllElements(); From eebab2b78bdf75d627fb4cd633ca27f81e9b02c0 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 15:06:55 +0300 Subject: [PATCH 2/6] fixed crash upon unpause bug --- game.cpp | 24 +++++++++++++++++------- game.h | 1 + inGameAppState.cpp | 10 +--------- inGameAppState.h | 1 - 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/game.cpp b/game.cpp index 15641fb..f19695c 100644 --- a/game.cpp +++ b/game.cpp @@ -43,11 +43,9 @@ namespace battleship{ } void Game::update(){ + updateLuaPlayers(false); sol::state_view SOL_LUA_VIEW = generateView(); - for(int i = 0; i < players.size(); i++) - SOL_LUA_VIEW["game"]["players"][i + 1] = players[i]; - for(int i = 0; i < players.size(); i++) if(players[i]->isCpuPlayer()){ string plStr = "game.players[" + to_string(i + 1) + "]"; @@ -78,6 +76,15 @@ namespace battleship{ FxManager::getSingleton()->update(); } + void Game::updateLuaPlayers(bool resetBehaviour){ + sol::state_view SOL_LUA_VIEW = generateView(); + + for(int i = 0; i < players.size(); i++) + SOL_LUA_VIEW["game"]["players"][i + 1] = players[i]; + + if(resetBehaviour) + SOL_LUA_VIEW.script_file(GameManager::getSingleton()->getPath() + "Scripts/Core/playerInit.lua"); + } void Game::removeAllElements(){ generateView().script("game.players = {}"); @@ -101,11 +108,14 @@ namespace battleship{ guiManager->readLuaScreenScript("gamePaused.lua", activeState->getGuiButtons()); } else { - for(string f : configData::scripts) - generateView().script_file(gm->getPath() + f); - - guiManager->readLuaScreenScript("inGame.lua", activeState->getGuiButtons()); sol::state_view SOL_LUA_VIEW = generateView(); + + for(string f : configData::scripts) + SOL_LUA_VIEW.script_file(gm->getPath() + f); + + updateLuaPlayers(true); + guiManager->readLuaScreenScript("inGame.lua", activeState->getGuiButtons()); + string gop = SOL_LUA_VIEW["gameObjPrefix"], vfxp = SOL_LUA_VIEW["vfxPrefix"]; AssetManager::getSingleton()->load(gm->getPath() + gop, true); AssetManager::getSingleton()->load(gm->getPath() + vfxp, true); diff --git a/game.h b/game.h index 1d862af..e5a283d 100644 --- a/game.h +++ b/game.h @@ -20,6 +20,7 @@ namespace battleship{ public: static Game* getSingleton(); void update(); + void updateLuaPlayers(bool); void togglePause(); void removeAllElements(); void changeUnitPlayer(Unit*, Player*); diff --git a/inGameAppState.cpp b/inGameAppState.cpp index ea67c27..1013194 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -68,21 +68,13 @@ namespace battleship{ cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE); cam->lookAt(Vector3(0, -1, -1).norm(), Vector3(0, 1, -1).norm()); - mainPlayer = Game::getSingleton()->getPlayer(playerId); - GameManager *gm = GameManager::getSingleton(); StateManager *stateManager = gm->getStateManager(); GuiAppState *guiState = ((GuiAppState*)stateManager->getAppStateByType((int)AppStateType::GUI_STATE)); activeState = new ActiveGameState(guiState, playerId); stateManager->attachAppState(activeState); - sol::state_view SOL_LUA_VIEW = generateView(); - vector players = Game::getSingleton()->getPlayers(); - - for(int i = 0; i < players.size(); i++) - SOL_LUA_VIEW["game"]["players"][i + 1] = players[i]; - - SOL_LUA_VIEW.script_file(gm->getPath() + "Scripts/Core/playerInit.lua"); + Game::getSingleton()->updateLuaPlayers(true); } void InGameAppState::onDettached() { diff --git a/inGameAppState.h b/inGameAppState.h index 1f2c036..14172d5 100755 --- a/inGameAppState.h +++ b/inGameAppState.h @@ -51,7 +51,6 @@ namespace battleship{ private: bool isMainMenuActive = false; std::vector modelPaths; - Player *mainPlayer; int playerId; std::string mapName = ""; ActiveGameState* activeState; From 4a96642c390749a267051aa6f6408e0c00e3ea59 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 15:24:59 +0300 Subject: [PATCH 3/6] rendering path points and hitboxes only with debug mode enabled --- gameObject.cpp | 6 ++++-- vehicle.cpp | 11 ++--------- vehicle.h | 1 - 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gameObject.cpp b/gameObject.cpp index 2ee2c76..f895437 100644 --- a/gameObject.cpp +++ b/gameObject.cpp @@ -1,8 +1,9 @@ #include "gameObject.h" #include "gameManager.h" #include "defConfigs.h" -#include "unit.h" #include "player.h" +#include "game.h" +#include "unit.h" #include @@ -29,6 +30,7 @@ namespace battleship{ Box *hbMesh = (Box*)hitbox->getMesh(0); hbMesh->setSize(Vector3(width, height, length)); hbMesh->updateVerts(hbMesh->getMeshBase()); + hitbox->setVisible(Game::getSingleton()->isDebug()); } } @@ -68,7 +70,7 @@ namespace battleship{ hitbox = new Node(Vector3(offsetPosTable["x"], offsetPosTable["y"], offsetPosTable["z"])); hitbox->attachMesh(box); - hitbox->setVisible(true); + hitbox->setVisible(Game::getSingleton()->isDebug()); model->attachChild(hitbox); } diff --git a/vehicle.cpp b/vehicle.cpp index 1c5eb69..0cdec74 100644 --- a/vehicle.cpp +++ b/vehicle.cpp @@ -22,16 +22,10 @@ using namespace std; namespace battleship{ Vehicle::Vehicle(Player *player, int id, Vector3 pos, Quaternion rot, Unit::State state) : Unit(player, id, pos, rot, state){ initProperties(); - - debugMat = new Material(Root::getSingleton()->getLibPath() + "texture"); - debugMat->addBoolUniform("lightingEnabled", false); - debugMat->addBoolUniform("texturingEnabled", false); - debugMat->addVec4Uniform("diffuseColor", Vector4::VEC_IJKL); } Vehicle::~Vehicle(){ removeAllPathpoints(); - delete debugMat; } void Vehicle::update(){ @@ -237,13 +231,12 @@ namespace battleship{ pathPoints.push_back(pointPos); Box *b = new Box(Vector3::VEC_IJK); - b->setMaterial(debugMat); + b->setMaterial(player->getColorMaterial()); Node *n = new Node(pointPos); n->attachMesh(b); - + n->setVisible(Game::getSingleton()->isDebug()); Root::getSingleton()->getRootNode()->attachChild(n); - debugPathPoints.push_back(n); } diff --git a/vehicle.h b/vehicle.h index 9bbb184..446830e 100644 --- a/vehicle.h +++ b/vehicle.h @@ -21,7 +21,6 @@ namespace battleship{ Unit *garrisonable = nullptr; int patrolPointId = 0, garrisonCategory; float speed, maxTurnAngle, anglePrecision; - vb01::Material *debugMat = nullptr; std::vector debugPathPoints; vb01::s64 lastBuildTime = 0; From a7d9bc129819792ecc69af4ffda2400a39185597 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 15:56:50 +0300 Subject: [PATCH 4/6] preserving unit buttons when (un)pausing improved minimap element rendering --- activeGameState.cpp | 10 ++++++---- activeGameState.h | 1 - game.cpp | 2 +- map.cpp | 7 +++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/activeGameState.cpp b/activeGameState.cpp index 536e188..ac6e858 100755 --- a/activeGameState.cpp +++ b/activeGameState.cpp @@ -120,15 +120,18 @@ namespace battleship{ void ActiveGameState::onAttached() { AbstractAppState::onAttached(); + vector buttons = guiButtons; + buttons.insert(buttons.end(), unitButtons.begin(), unitButtons.end()); + ConcreteGuiManager::getSingleton()->readLuaScreenScript( "activeGameState.lua", - vector{}, + buttons, vector{}, vector{}, vector{}, vector{}, - vector{}, - vector{}, + guiRects, + guiTexts, "music = generateFactionMusic(" + to_string(mainPlayer->getFaction()) + ")" ); @@ -375,7 +378,6 @@ namespace battleship{ ufCtr->removeGameObjectFrames(); ufCtr->toggleFrameTransformations(false, false, false); - unitGuiScreen = ""; ConcreteGuiManager::getSingleton()->readLuaScreenScript("activeGameState.lua"); } diff --git a/activeGameState.h b/activeGameState.h index 63740c7..0778be1 100755 --- a/activeGameState.h +++ b/activeGameState.h @@ -81,7 +81,6 @@ namespace battleship{ CursorState cursorState = CursorState::NORMAL; Player *mainPlayer; GuiAppState *guiState; - std::string unitGuiScreen = ""; GameObject *gameObjHoveredOn = nullptr; vb01::Vector2 clickPoint; std::vector unitGroups[9], prevSelectedUnits; diff --git a/game.cpp b/game.cpp index f19695c..2eb58de 100644 --- a/game.cpp +++ b/game.cpp @@ -105,7 +105,7 @@ namespace battleship{ if (!paused) { gm->getStateManager()->dettachAppState(activeState); - guiManager->readLuaScreenScript("gamePaused.lua", activeState->getGuiButtons()); + guiManager->parseLuaScript("gamePaused.lua"); } else { sol::state_view SOL_LUA_VIEW = generateView(); diff --git a/map.cpp b/map.cpp index cc59156..f69dc36 100755 --- a/map.cpp +++ b/map.cpp @@ -96,6 +96,7 @@ namespace battleship{ Node *node = new Node(minimapPos + Vector3(iconPos.x, iconPos.y, .1) - .5 * iconSize); node->attachMesh(quad); + node->setVisible(false); root->getGuiNode()->attachChild(node); return node; @@ -193,6 +194,9 @@ namespace battleship{ } void Map::Minimap::load(){ + for(Node *node : depositIcons) + node->setVisible(true); + AssetManager *am = AssetManager::getSingleton(); string minimapPath = GameManager::getSingleton()->getPath() + "Models/Maps/" + Map::getSingleton()->getMapName() + "/minimap.jpg"; @@ -206,6 +210,9 @@ namespace battleship{ } void Map::Minimap::unload(){ + for(Node *node : depositIcons) + node->setVisible(false); + delete[] oldImageData; } From dd3f1d3be2bd93bbfbdba01bcc88bb7377df5bb3 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 16:13:08 +0300 Subject: [PATCH 5/6] updating the minimap after loading the map --- inGameAppState.cpp | 1 + unit.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/inGameAppState.cpp b/inGameAppState.cpp index 1013194..8f800a1 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -75,6 +75,7 @@ namespace battleship{ stateManager->attachAppState(activeState); Game::getSingleton()->updateLuaPlayers(true); + Map::Minimap::getSingleton()->updateImage(); } void InGameAppState::onDettached() { diff --git a/unit.cpp b/unit.cpp index c7fc9a2..fcee7e1 100755 --- a/unit.cpp +++ b/unit.cpp @@ -523,7 +523,7 @@ namespace battleship{ ActiveGameState *activeState = (ActiveGameState*)GameManager::getSingleton()->getStateManager()->getAppStateByType(AppStateType::ACTIVE_STATE); if(activeState && activeState->getPlayer()) - Map::Minimap::getSingleton()->updateImage(); + Map::Minimap::getSingleton()->updateImage(); } vector Unit::getSelectingPlayers(){ From 9feb7936a1ccb8063267e81466b8d91c650cd649 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 22 Jun 2025 16:26:46 +0300 Subject: [PATCH 6/6] only rendering garrisoned units --- activeGameState.cpp | 2 ++ map.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/activeGameState.cpp b/activeGameState.cpp index ac6e858..719503a 100755 --- a/activeGameState.cpp +++ b/activeGameState.cpp @@ -501,6 +501,8 @@ namespace battleship{ vector selUnits = mainPlayer->getSelectedUnits(); for (Unit *u : units) { + if(u->isVehicle() && ((Vehicle*)u)->getGarrisonable()) continue; + Node *model = u->getModel(); if (u->getPlayer()->getTeam() == mainPlayer->getTeam()){ diff --git a/map.cpp b/map.cpp index f69dc36..980d6fc 100755 --- a/map.cpp +++ b/map.cpp @@ -13,6 +13,7 @@ #include "map.h" #include "util.h" +#include "vehicle.h" #include "game.h" #include "player.h" #include "gameObject.h" @@ -102,6 +103,7 @@ namespace battleship{ return node; } + //TODO add a flag to Player::getUnits* whether to include garrisoned units void Map::Minimap::updateImage(){ GameManager *gm = GameManager::getSingleton(); Map *map = Map::getSingleton(); @@ -120,6 +122,8 @@ namespace battleship{ vector units = pl->getUnits(); for(Unit *u : units){ + if(u->isVehicle() && ((Vehicle*)u)->getGarrisonable()) continue; + Vector2 coords = Vector2( int(u->getPos().x / mapSize.x * width), int(-u->getPos().z / mapSize.z * height)