only rendering garrisoned units

This commit is contained in:
devZoGok
2025-06-22 16:26:46 +03:00
parent dd3f1d3be2
commit 9feb7936a1
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -501,6 +501,8 @@ namespace battleship{
vector<Unit*> selUnits = mainPlayer->getSelectedUnits();
for (Unit *u : units) {
if(u->isVehicle() && ((Vehicle*)u)->getGarrisonable()) continue;
Node *model = u->getModel();
if (u->getPlayer()->getTeam() == mainPlayer->getTeam()){
+4
View File
@@ -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<Unit*> 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)