mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Tweaks and implemented workaround to MIST bug
This commit is contained in:
@@ -163,7 +163,7 @@ public:
|
||||
priority = immediate? CommandPriority::IMMEDIATE: CommandPriority::LOW;
|
||||
};
|
||||
virtual string getString(lua_State* L);
|
||||
virtual unsigned int getLoad() { return 100 * !immediate; }
|
||||
virtual unsigned int getLoad() { return immediate? 1: 100; }
|
||||
|
||||
private:
|
||||
const string coalition;
|
||||
@@ -172,7 +172,29 @@ private:
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
/* Spawn air unit command */
|
||||
/* Spawn navy unit command */
|
||||
class SpawnNavyUnits : public Command
|
||||
{
|
||||
public:
|
||||
SpawnNavyUnits(string coalition, vector<string> unitTypes, vector<Coords> locations, bool immediate) :
|
||||
coalition(coalition),
|
||||
unitTypes(unitTypes),
|
||||
locations(locations),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
};
|
||||
virtual string getString(lua_State* L);
|
||||
virtual unsigned int getLoad() { return immediate ? 1 : 100; }
|
||||
|
||||
private:
|
||||
const string coalition;
|
||||
const vector<string> unitTypes;
|
||||
const vector<Coords> locations;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
/* Spawn aircraft command */
|
||||
class SpawnAircrafts : public Command
|
||||
{
|
||||
public:
|
||||
@@ -187,7 +209,34 @@ public:
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
};
|
||||
virtual string getString(lua_State* L);
|
||||
virtual unsigned int getLoad() { return 100 * !immediate; }
|
||||
virtual unsigned int getLoad() { return immediate ? 1 : 100; }
|
||||
|
||||
private:
|
||||
const string coalition;
|
||||
const vector<string> unitTypes;
|
||||
const vector<Coords> locations;
|
||||
const vector<string> loadouts;
|
||||
const string airbaseName;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
|
||||
/* Spawn helicopter command */
|
||||
class SpawnHelicopters : public Command
|
||||
{
|
||||
public:
|
||||
SpawnHelicopters(string coalition, vector<string> unitTypes, vector<Coords> locations, vector<string> loadouts, string airbaseName, bool immediate) :
|
||||
coalition(coalition),
|
||||
unitTypes(unitTypes),
|
||||
locations(locations),
|
||||
loadouts(loadouts),
|
||||
airbaseName(airbaseName),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
|
||||
};
|
||||
virtual string getString(lua_State* L);
|
||||
virtual unsigned int getLoad() { return immediate ? 1 : 100; }
|
||||
|
||||
private:
|
||||
const string coalition;
|
||||
@@ -220,18 +269,21 @@ private:
|
||||
class Delete : public Command
|
||||
{
|
||||
public:
|
||||
Delete(unsigned int ID, bool explosion) :
|
||||
Delete(unsigned int ID, bool explosion, bool immediate ) :
|
||||
ID(ID),
|
||||
explosion(explosion)
|
||||
explosion(explosion),
|
||||
immediate(immediate)
|
||||
{
|
||||
priority = CommandPriority::HIGH;
|
||||
immediate = immediate;
|
||||
};
|
||||
virtual string getString(lua_State* L);
|
||||
virtual unsigned int getLoad() { return 20; }
|
||||
virtual unsigned int getLoad() { return immediate? 1: 20; }
|
||||
|
||||
private:
|
||||
const unsigned int ID;
|
||||
const bool explosion;
|
||||
const bool immediate;
|
||||
};
|
||||
|
||||
/* SetTask command */
|
||||
|
||||
@@ -10,6 +10,7 @@ public:
|
||||
~Scheduler();
|
||||
|
||||
void appendCommand(Command* command);
|
||||
int getCurrentLoad();
|
||||
void execute(lua_State* L);
|
||||
void handleRequest(string key, json::value value);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
void updateMissionData(json::value missionData);
|
||||
void runAILoop();
|
||||
string getUnitData(stringstream &ss, unsigned long long time);
|
||||
void deleteUnit(unsigned int ID, bool explosion);
|
||||
void deleteUnit(unsigned int ID, bool explosion, bool immediate);
|
||||
void acquireControl(unsigned int ID);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user