mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Completed transition to weapons handler
This commit is contained in:
@@ -115,7 +115,7 @@ extern "C" DllExport int coreUnitsData(lua_State * L)
|
||||
return(0);
|
||||
}
|
||||
|
||||
extern "C" DllExport int coreWeaponssData(lua_State * L)
|
||||
extern "C" DllExport int coreWeaponsData(lua_State * L)
|
||||
{
|
||||
if (!initialized)
|
||||
return (0);
|
||||
|
||||
@@ -72,7 +72,7 @@ void Unit::update(json::value json, double dt)
|
||||
if (json.has_boolean_field(L"isAlive"))
|
||||
setAlive(json[L"isAlive"].as_bool());
|
||||
|
||||
if (json.has_object_field(L"isHuman"))
|
||||
if (json.has_boolean_field(L"isHuman"))
|
||||
setHuman(json[L"isHuman"].as_bool());
|
||||
|
||||
if (json.has_number_field(L"fuel")) {
|
||||
@@ -109,7 +109,7 @@ void Unit::update(json::value json, double dt)
|
||||
contactItem.ID = contactJson[L"object"][L"id_"].as_number().to_uint32();
|
||||
|
||||
string detectionMethod = to_string(contactJson[L"detectionMethod"]);
|
||||
if (detectionMethod.compare("VISUAL") == 0) contactItem.detectionMethod = 1;
|
||||
if (detectionMethod.compare("VISUAL") == 0) contactItem.detectionMethod = 1;
|
||||
else if (detectionMethod.compare("OPTIC") == 0) contactItem.detectionMethod = 2;
|
||||
else if (detectionMethod.compare("RADAR") == 0) contactItem.detectionMethod = 4;
|
||||
else if (detectionMethod.compare("IRST") == 0) contactItem.detectionMethod = 8;
|
||||
|
||||
@@ -110,10 +110,6 @@ void UnitsManager::update(json::value& json, double dt)
|
||||
units[ID] = dynamic_cast<Unit*>(new GroundUnit(p.second, ID));
|
||||
else if (category.compare("NavyUnit") == 0)
|
||||
units[ID] = dynamic_cast<Unit*>(new NavyUnit(p.second, ID));
|
||||
else if (category.compare("Missile") == 0)
|
||||
units[ID] = dynamic_cast<Unit*>(new Missile(p.second, ID));
|
||||
else if (category.compare("Bomb") == 0)
|
||||
units[ID] = dynamic_cast<Unit*>(new Bomb(p.second, ID));
|
||||
|
||||
/* Initialize the unit if creation was successfull */
|
||||
if (units.count(ID) != 0) {
|
||||
|
||||
@@ -69,21 +69,21 @@ static int onSimulationStart(lua_State* L)
|
||||
goto error;
|
||||
}
|
||||
|
||||
coreUnitsData = (f_coreFrame)GetProcAddress(hGetProcIDDLL, "coreUnitsData");
|
||||
coreUnitsData = (f_coreUnitsData)GetProcAddress(hGetProcIDDLL, "coreUnitsData");
|
||||
if (!coreUnitsData)
|
||||
{
|
||||
LogError(L, "Error getting coreUnitsData ProcAddress from DLL");
|
||||
goto error;
|
||||
}
|
||||
|
||||
coreWeaponsData = (f_coreFrame)GetProcAddress(hGetProcIDDLL, "coreWeaponsData");
|
||||
coreWeaponsData = (f_coreWeaponsData)GetProcAddress(hGetProcIDDLL, "coreWeaponsData");
|
||||
if (!coreWeaponsData)
|
||||
{
|
||||
LogError(L, "Error getting coreWeaponsData ProcAddress from DLL");
|
||||
goto error;
|
||||
}
|
||||
|
||||
coreMissionData = (f_coreFrame)GetProcAddress(hGetProcIDDLL, "coreMissionData");
|
||||
coreMissionData = (f_coreMissionData)GetProcAddress(hGetProcIDDLL, "coreMissionData");
|
||||
if (!coreMissionData)
|
||||
{
|
||||
LogError(L, "Error getting coreMissionData ProcAddress from DLL");
|
||||
|
||||
Reference in New Issue
Block a user