From d09d29f52087a570965983ae3df004f359f19863 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sun, 2 Jan 2011 12:18:14 +0000 Subject: [PATCH] new default settings for ultra/easy/mega ; dansk.lng up to date ; code cleanup --- source/glest_game/global/config.cpp | 6 +- source/glest_game/world/unit_updater.cpp | 69 -------------------- source/shared_lib/include/util/leak_dumper.h | 2 +- 3 files changed, 4 insertions(+), 73 deletions(-) diff --git a/source/glest_game/global/config.cpp b/source/glest_game/global/config.cpp index c3de9be2..d659450f 100644 --- a/source/glest_game/global/config.cpp +++ b/source/glest_game/global/config.cpp @@ -33,9 +33,9 @@ int GameConstants::updateFps = 40; int GameConstants::cameraFps = 100; const float GameConstants::normalMultiplier = 1.0f; -const float GameConstants::easyMultiplier = 0.8f; -const float GameConstants::ultraMultiplier = 3.0f; -const float GameConstants::megaMultiplier = 4.0f; +const float GameConstants::easyMultiplier = 0.5f; +const float GameConstants::ultraMultiplier = 2.0f; +const float GameConstants::megaMultiplier = 3.0f; const char *GameConstants::folder_path_maps = "maps"; const char *GameConstants::folder_path_scenarios = "scenarios"; diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index c081dfd5..a4e10453 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -188,11 +188,6 @@ void UnitUpdater::updateUnitCommand(Unit *unit) { //if unit has command process it if(unit->anyCommand()) { CommandClass cc=unit->getCurrCommand()->getCommandType()->commandTypeClass; -// if(unit->isOperative() && (!(cc==ccStop || cc==ccAttack)) ) -// {//stop and attack already check for themselves -// Unit *sighted; -// attackerOnSight(unit, &sighted); -// } unit->getCurrCommand()->getCommandType()->update(this, unit); } @@ -207,12 +202,6 @@ void UnitUpdater::updateUnitCommand(Unit *unit) { //SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); unit->giveCommand(new Command(unit->getType()->getFirstCtOfClass(ccStop))); } -// else -// { -// // buidings have no stop skill but have to check for attackers too. -// Unit *sighted; -// attackerOnSight(unit, &sighted); -// } } if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld --------------------------- [END OF METHOD] ---------------------------\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); @@ -1864,64 +1853,6 @@ bool UnitUpdater::unitOnRange(const Unit *unit, int range, Unit **rangedPtr, } } } - -// if( result && -// unit->getTeam()==world->getThisTeamIndex() && //must be in local players team. -// !(unit->isAlly(enemySeen))) -// { -// // find nearest Attack and cleanup old dates -// AttackWarningData *nearest=NULL; -// float currentDistance; -// float nearestDistance; -// for(int i = attackWarnings.size()-1; i>-1; --i) { -// if(world->getFrameCount()-attackWarnings[i]->lastFrameCount>200) { //after 200 frames attack break we warn again -// AttackWarningData *toDelete=attackWarnings[i]; -// attackWarnings.erase(attackWarnings.begin()+i); -// delete toDelete; // old one -// } -// else { -// currentDistance=floor(floatCenter.dist(attackWarnings[i]->attackPosition)); // no need for streflops here! -// if( nearest==NULL ){ -// nearest=attackWarnings[i]; -// nearestDistance=currentDistance; -// } -// else { -// -// if( currentDistance< nearestDistance ){ -// nearest=attackWarnings[i]; -// nearestDistance=currentDistance; -// } -// } -// } -// } -// -// if(nearest!=NULL) -// { // does it fit? -// if(nearestDistancelastFrameCount=world->getFrameCount(); -// nearest->attackPosition.x=enemySeen->getFloatCenteredPos().x; -// nearest->attackPosition.y=enemySeen->getFloatCenteredPos().y; -// } -// else -// {//Must be a different Attack! -// nearest=NULL; //set to null to force a new entry in next step -// } -// } -// // add new attack -// if(nearest==NULL) // no else! -// { -// AttackWarningData* awd= new AttackWarningData(); -// awd->lastFrameCount=world->getFrameCount(); -// awd->attackPosition.x=enemySeen->getFloatCenteredPos().x; -// awd->attackPosition.y=enemySeen->getFloatCenteredPos().y; -// attackWarnings.push_back(awd); -// SoundRenderer::getInstance().playFx(CoreData::getInstance().getAttentionSound()); -// world->addAttackEffects(enemySeen); -// } -// } - - return result; } diff --git a/source/shared_lib/include/util/leak_dumper.h b/source/shared_lib/include/util/leak_dumper.h index 0b5864ae..39c388fb 100644 --- a/source/shared_lib/include/util/leak_dumper.h +++ b/source/shared_lib/include/util/leak_dumper.h @@ -27,7 +27,7 @@ using namespace std; //including this header in any file of a project will cause all //leaks to be dumped into leak_dump.txt, but only allocations that -//ocurred in a file where this header is included will have +//occurred in a file where this header is included will have //file and line number struct AllocInfo{