Fix coding guidelines + double initialized as 0.0

This commit is contained in:
Guillaume Dupuy 2016-10-20 16:02:02 +02:00
parent ad48baa3b1
commit 3e9ee0954b
8 changed files with 18 additions and 17 deletions

View file

@ -1085,7 +1085,7 @@ void CGameItem::resetEnchantment()
_SapLoad = 0;
_Enchantment.clear();
contReset( _Enchantment );
_LatencyEndDate = 0.0f;
_LatencyEndDate = 0.0;
if (getInventory() != NULL)
getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_enchant));
@ -1351,7 +1351,7 @@ void CGameItem::clear()
_Destroyable = true;
_Dropable = true;
// _SlotImage = 0xFFFF;
_LatencyEndDate = 0.0f;
_LatencyEndDate = 0.0;
// _Parent = NULL;
_Inventory = NULL;
_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....
if (itemPtr->hitRate() != 0)
{
LatencyInTicks = (10.0f / itemPtr->hitRate() ) / CTickEventHandler::getGameTimeStep();
LatencyInTicks = (10.0 / itemPtr->hitRate() ) / CTickEventHandler::getGameTimeStep();
}
Quality = (uint16)itemPtr->recommended();

View file

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

View file

@ -382,7 +382,7 @@ void CCombatPhrase::init()
_CriticalHit = false;
_ExecutionEndDate = 0;
_LatencyEndDate = 0.0f;
_LatencyEndDate = 0.0;
_SabrinaCost = 0;
_SabrinaRelativeCost = 1.0f;
@ -892,7 +892,7 @@ bool CCombatPhrase::evaluate()
_NotEnoughStaminaMsg = false;
_NotEnoughHpMsg = false;
_DisengageOnEnd = false;
_LatencyEndDate = 0.0f;
_LatencyEndDate = 0.0;
_ExecutionEndDate = 0;
return true;
@ -1702,7 +1702,7 @@ bool CCombatPhrase::launch()
{
H_AUTO(CCombatPhrase_launch);
_LatencyEndDate = 0.0f;
_LatencyEndDate = 0.0;
_ApplyDate = 0;
if ( !_Attacker )

View file

@ -1568,7 +1568,7 @@ bool CMagicPhrase::launch()
if (_DivineInterventionOccured||_ShootAgainOccured?_BaseCastingTime:_CastingTime)
_LatencyEndDate = (double)time + PostCastLatency + _PostCastTime;
else
_LatencyEndDate = 0.0f + _PostCastTime;
_LatencyEndDate = 0.0 + _PostCastTime;
// compute the apply date
if ( !_Targets.empty() && _ActorRowId != _Targets[0].getId())
@ -1898,7 +1898,7 @@ void CMagicPhrase::enchantPhrase(CCharacter * user,float successFactor)
_Targets.resize(1);
// 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;
} // enchantPhrase //

View file

@ -463,7 +463,8 @@ void CPhraseManager::updatePhrases()
updateEntityCurrentAction( (*it).first, entityPhrases);
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 !
} while(phrase != NULL && old_state != phrase->state());
}
while(phrase != NULL && old_state != phrase->state());
// get next entity sentences
++it;

View file

@ -56,7 +56,7 @@ public:
_Idle = false;
_ExecutionEndDate = 0;
_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;
_NextCounter = 0;
_IsStatic = false;

View file

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