mirror of
https://github.com/glest/glest-source.git
synced 2025-08-24 08:52:49 +02:00
- memory leak and a few other minor bug fixes as discovered by coverity scan.
This commit is contained in:
@@ -1033,8 +1033,11 @@ void ScriptManager::shakeCamera(int shakeIntensity, int shakeDuration, bool came
|
||||
|
||||
if (cameraDistanceAffected) {
|
||||
Unit *unit = world->findUnitById(unitId);
|
||||
if(unit) {
|
||||
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, unit->getCurrMidHeightVector());
|
||||
} else {
|
||||
}
|
||||
}
|
||||
else {
|
||||
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, Vec3f(0.f,0.f,0.f));
|
||||
}
|
||||
}
|
||||
@@ -1542,7 +1545,12 @@ int ScriptManager::getUnitFaction(int unitId) {
|
||||
const string ScriptManager::getUnitName(int unitId) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
||||
return world->findUnitById(unitId)->getType()->getName(false);
|
||||
string result = "";
|
||||
Unit *unit = world->findUnitById(unitId);
|
||||
if(unit) {
|
||||
result = world->findUnitById(unitId)->getType()->getName(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const string ScriptManager::getUnitDisplayName(int unitId) {
|
||||
|
@@ -968,6 +968,9 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
||||
delete projectileType;
|
||||
}
|
||||
}
|
||||
else {
|
||||
delete projectileType;
|
||||
}
|
||||
//proj sounds
|
||||
const XmlNode *soundNode= projectileNode->getChild("sound");
|
||||
if(soundNode->getAttribute("enabled")->getBoolValue()){
|
||||
|
@@ -2676,10 +2676,10 @@ int UPNP_Tools::upnp_init(void *param) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"No UPnP devices found.\n");
|
||||
|
||||
if(ServerSocket::cancelUpnpdiscoverThread == true) {
|
||||
if(devlist != NULL) {
|
||||
freeUPNPDevlist(devlist);
|
||||
}
|
||||
devlist = NULL;
|
||||
//if(devlist != NULL) {
|
||||
// freeUPNPDevlist(devlist);
|
||||
//}
|
||||
//devlist = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user