Fix coding guidelines + double initialized as 0.0

--HG--
branch : fix_speed
This commit is contained in:
Guillaume Dupuy 2016-10-20 16:02:02 +02:00
parent a79c371598
commit 7592d3e6c4
8 changed files with 18 additions and 17 deletions

View file

@ -1085,7 +1085,7 @@ void CGameItem::resetEnchantment()
_SapLoad = 0; _SapLoad = 0;
_Enchantment.clear(); _Enchantment.clear();
contReset( _Enchantment ); contReset( _Enchantment );
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
if (getInventory() != NULL) if (getInventory() != NULL)
getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_enchant)); getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_enchant));
@ -1351,7 +1351,7 @@ void CGameItem::clear()
_Destroyable = true; _Destroyable = true;
_Dropable = true; _Dropable = true;
// _SlotImage = 0xFFFF; // _SlotImage = 0xFFFF;
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
// _Parent = NULL; // _Parent = NULL;
_Inventory = NULL; _Inventory = NULL;
_InventorySlot = INVENTORIES::INVALID_INVENTORY_SLOT; _InventorySlot = INVENTORIES::INVALID_INVENTORY_SLOT;

View file

@ -130,7 +130,7 @@ CCombatWeapon::CCombatWeapon(CGameItemPtr itemPtr)
// weapon hit rate is in hit/10s and we use ticks/hits.... // weapon hit rate is in hit/10s and we use ticks/hits....
if (itemPtr->hitRate() != 0) if (itemPtr->hitRate() != 0)
{ {
LatencyInTicks = (10.0f / itemPtr->hitRate() ) / CTickEventHandler::getGameTimeStep(); LatencyInTicks = (10.0 / itemPtr->hitRate() ) / CTickEventHandler::getGameTimeStep();
} }
Quality = (uint16)itemPtr->recommended(); Quality = (uint16)itemPtr->recommended();

View file

@ -111,7 +111,7 @@ public:
private: private:
void init() void init()
{ {
LatencyInTicks = 0.0f; LatencyInTicks = 0.0;
Damage = 0; Damage = 0;
Quality = 0; Quality = 0;
DmgType = DMGTYPE::UNDEFINED; DmgType = DMGTYPE::UNDEFINED;

View file

@ -382,7 +382,7 @@ void CCombatPhrase::init()
_CriticalHit = false; _CriticalHit = false;
_ExecutionEndDate = 0; _ExecutionEndDate = 0;
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
_SabrinaCost = 0; _SabrinaCost = 0;
_SabrinaRelativeCost = 1.0f; _SabrinaRelativeCost = 1.0f;
@ -892,7 +892,7 @@ bool CCombatPhrase::evaluate()
_NotEnoughStaminaMsg = false; _NotEnoughStaminaMsg = false;
_NotEnoughHpMsg = false; _NotEnoughHpMsg = false;
_DisengageOnEnd = false; _DisengageOnEnd = false;
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
_ExecutionEndDate = 0; _ExecutionEndDate = 0;
return true; return true;
@ -1702,7 +1702,7 @@ bool CCombatPhrase::launch()
{ {
H_AUTO(CCombatPhrase_launch); H_AUTO(CCombatPhrase_launch);
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
_ApplyDate = 0; _ApplyDate = 0;
if ( !_Attacker ) if ( !_Attacker )
@ -2183,7 +2183,7 @@ bool CCombatPhrase::launch()
} }
else else
{ {
_LatencyEndDate = (double)time + latency; _LatencyEndDate = (double)time + latency;
} }
// compute the apply date // compute the apply date
if (_Targets[0].Target!=NULL && actingEntity->getEntityRowId() == _Targets[0].Target->getEntityRowId()) if (_Targets[0].Target!=NULL && actingEntity->getEntityRowId() == _Targets[0].Target->getEntityRowId())

View file

@ -1568,7 +1568,7 @@ bool CMagicPhrase::launch()
if (_DivineInterventionOccured||_ShootAgainOccured?_BaseCastingTime:_CastingTime) if (_DivineInterventionOccured||_ShootAgainOccured?_BaseCastingTime:_CastingTime)
_LatencyEndDate = (double)time + PostCastLatency + _PostCastTime; _LatencyEndDate = (double)time + PostCastLatency + _PostCastTime;
else else
_LatencyEndDate = 0.0f + _PostCastTime; _LatencyEndDate = 0.0 + _PostCastTime;
// compute the apply date // compute the apply date
if ( !_Targets.empty() && _ActorRowId != _Targets[0].getId()) if ( !_Targets.empty() && _ActorRowId != _Targets[0].getId())
@ -1898,7 +1898,7 @@ void CMagicPhrase::enchantPhrase(CCharacter * user,float successFactor)
_Targets.resize(1); _Targets.resize(1);
// user->setActionFlag( RYZOMACTIONFLAGS::Attacks, true ); // user->setActionFlag( RYZOMACTIONFLAGS::Attacks, true );
_LatencyEndDate = 0.0f;//time + _HitRateModifier + weapon.LatencyInTicks + ammo.SpeedInTicks ; _LatencyEndDate = 0.0;//time + _HitRateModifier + weapon.LatencyInTicks + ammo.SpeedInTicks ;
// _BeingProcessed = false; // _BeingProcessed = false;
} // enchantPhrase // } // enchantPhrase //

View file

@ -459,11 +459,12 @@ void CPhraseManager::updatePhrases()
CSPhrase::TPhraseState old_state; CSPhrase::TPhraseState old_state;
do do
{ {
old_state = phrase->state(); old_state = phrase->state();
updateEntityCurrentAction( (*it).first, entityPhrases); updateEntityCurrentAction( (*it).first, entityPhrases);
phrase = entityPhrases.getCurrentAction(); phrase = entityPhrases.getCurrentAction();
//Every time we get the next action, th phrase might be deleted (if the action is invalid or finished for non-cyclic actions like digging / crafting), always check ! //Every time we get the next action, th phrase might be deleted (if the action is invalid or finished for non-cyclic actions like digging / crafting), always check !
} while(phrase != NULL && old_state != phrase->state()); }
while(phrase != NULL && old_state != phrase->state());
// get next entity sentences // get next entity sentences
++it; ++it;

View file

@ -56,7 +56,7 @@ public:
_Idle = false; _Idle = false;
_ExecutionEndDate = 0; _ExecutionEndDate = 0;
_ApplyDate = ~0; // ensure apply() never called before launch() _ApplyDate = ~0; // ensure apply() never called before launch()
_LatencyEndDate = 0.0f; // by default, time between apply() and end() is immediate _LatencyEndDate = 0.0; // by default, time between apply() and end() is immediate
_PhraseBookIndex = 0; _PhraseBookIndex = 0;
_NextCounter = 0; _NextCounter = 0;
_IsStatic = false; _IsStatic = false;

View file

@ -758,7 +758,7 @@ bool CSpecialPowerPhrase::launch()
//----------------------------------------------- //-----------------------------------------------
void CSpecialPowerPhrase::apply() void CSpecialPowerPhrase::apply()
{ {
_LatencyEndDate = 0.0f; _LatencyEndDate = 0.0;
// TODO // TODO
// apply effect // apply effect