mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
units can attack targets inspite of HOLD_FIRE when ordered exlicitly
This commit is contained in:
+3
-3
@@ -423,13 +423,13 @@ namespace battleship{
|
||||
|
||||
break;
|
||||
case Bind::ENABLE_CHASE_STATE:
|
||||
enableUnitState(Unit::State::CHASE);
|
||||
if(isPressed) enableUnitState(Unit::State::CHASE);
|
||||
break;
|
||||
case Bind::ENABLE_STAND_GROUND_STATE:
|
||||
enableUnitState(Unit::State::STAND_GROUND);
|
||||
if(isPressed) enableUnitState(Unit::State::STAND_GROUND);
|
||||
break;
|
||||
case Bind::ENABLE_HOLD_FIRE_STATE:
|
||||
enableUnitState(Unit::State::HOLD_FIRE);
|
||||
if(isPressed) enableUnitState(Unit::State::HOLD_FIRE);
|
||||
break;
|
||||
case Bind::DESELECT:
|
||||
if(ufCtr->isPlacingFrames()) ufCtr->setRotatingFrames(isPressed);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ namespace battleship{
|
||||
|
||||
const static int numAppStates = 4;
|
||||
const static int numStaticBinds[numAppStates]{6, 0, 5, 19};
|
||||
const static int numConfBinds[numAppStates]{0, 1, 23, 0};
|
||||
const static int numConfBinds[numAppStates]{0, 1, 26, 0};
|
||||
const static int maxStaticBinds = 19;
|
||||
const static int maxConfBinds = 23;
|
||||
const static int numScripts = 5;
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace battleship{
|
||||
if(orders.empty())
|
||||
for(Unit *unit : units)
|
||||
if(unit->getPos().getDistanceFrom(pos) < lineOfSight){
|
||||
setOrder(Order(Order::TYPE::ATTACK, vector<Order::Target>{Order::Target(unit)}, Vector3::VEC_ZERO, false));
|
||||
setOrder(Order(Order::TYPE::ATTACK, vector<Order::Target>{Order::Target(unit)}, Vector3::VEC_ZERO, -1, false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace battleship{
|
||||
std::vector<Target> targets;
|
||||
|
||||
Order(){}
|
||||
Order(TYPE t, std::vector<Target> targ, vb01::Vector3 dir, bool pa = true, int lid = -1) : type(t), playerAssigned(pa), lineId(lid), targets(targ), direction(dir){}
|
||||
Order(TYPE t, std::vector<Target> targ, vb01::Vector3 dir, int lid = -1, bool pa = true) : type(t), playerAssigned(pa), lineId(lid), targets(targ), direction(dir){}
|
||||
};
|
||||
|
||||
enum class MoveDir {LEFT, UP, FORW};
|
||||
|
||||
Reference in New Issue
Block a user