mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
cursors and attack orders only work on visible units
This commit is contained in:
+3
-1
@@ -225,6 +225,8 @@ namespace battleship{
|
||||
}
|
||||
|
||||
bool ActiveGameState::isGameObjSelectable(GameObject *obj, bool useDragBox){
|
||||
if(!obj->getModel()->isVisible()) return false;
|
||||
|
||||
Node *hitboxNode = obj->getHitbox();
|
||||
Box *hitbox = (Box*)hitboxNode->getMesh(0);
|
||||
|
||||
@@ -332,7 +334,7 @@ namespace battleship{
|
||||
vector<Unit*> selUnits = mainPlayer->getSelectedUnits();
|
||||
|
||||
for (Unit *u : units) {
|
||||
Node *model = u->getNode();
|
||||
Node *model = u->getModel();
|
||||
|
||||
if (u->getPlayer() == mainPlayer){
|
||||
if(!u->getLosLightNode()) u->initLosLight();
|
||||
|
||||
@@ -146,7 +146,6 @@ namespace battleship{
|
||||
inline int getNumGarrisonSlots(){return garrisonSlots.size();}
|
||||
inline const std::vector<GarrisonSlot>& getGarrisonSlots(){return garrisonSlots;}
|
||||
inline float getLineOfSight() {return lineOfSight;}
|
||||
inline vb01::Model* getNode() {return model;}
|
||||
inline UnitType getType() {return type;}
|
||||
inline UnitClass getUnitClass() {return unitClass;}
|
||||
inline void takeDamage(int damage) {health -= damage;}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ namespace battleship{
|
||||
void Vehicle::update(){
|
||||
Unit::update();
|
||||
|
||||
model->setVisible(!garrisonable);
|
||||
if(garrisonable) model->setVisible(false);
|
||||
}
|
||||
|
||||
void Vehicle::halt(){
|
||||
|
||||
Reference in New Issue
Block a user