diff --git a/zone/attack.cpp b/zone/attack.cpp index 4d8e57afb..f4eca4e50 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3832,7 +3832,7 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id) if (caster && amount > 0) { if (caster->IsNPC() && !caster->IsPet()) { float npchealscale = caster->CastToNPC()->GetHealScale(); - amount = (uint32)(amount * npchealscale) / 100.0f); + amount = (uint32)((amount * npchealscale) / 100.0f); } } diff --git a/zone/client.cpp b/zone/client.cpp index 61164e605..1627c64b6 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2133,9 +2133,9 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) { { m_pp.gold = gold/100; uint64 silvertest = (gold-(static_cast(m_pp.gold)*100))/10; - m_pp.silver += silvertest; + m_pp.silver =(int32)(m_pp.silver + silvertest); uint64 coppertest = (gold-(static_cast(m_pp.gold)*100+silvertest*10)); - m_pp.copper += coppertest; + m_pp.copper = (int32)(m_pp.copper + coppertest); if(updateclient) SendMoneyUpdate(); Save(); @@ -2148,11 +2148,11 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) { m_pp.platinum = platinum/1000; uint64 goldtest = (platinum-(static_cast(m_pp.platinum)*1000))/100; - m_pp.gold += goldtest; + m_pp.gold = (int32)(m_pp.gold +goldtest); uint64 silvertest = (platinum-(static_cast(m_pp.platinum)*1000+goldtest*100))/10; m_pp.silver += silvertest; uint64 coppertest = (platinum-(static_cast(m_pp.platinum)*1000+goldtest*100+silvertest*10)); - m_pp.copper = coppertest; + m_pp.copper = (int32)coppertest; if(updateclient) SendMoneyUpdate(); RecalcWeight(); @@ -2172,7 +2172,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ if(new_val < 0) { m_pp.platinum = 0; } else { - m_pp.platinum = m_pp.platinum + tmp2; + m_pp.platinum = (int32)(m_pp.platinum + tmp2); } tmp-=tmp2*1000; @@ -2181,11 +2181,11 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ // Add Amount of Gold tmp2 = tmp/100; - new_val = m_pp.gold + tmp2; + new_val = (int32)(m_pp.gold + tmp2); if(new_val < 0) { m_pp.gold = 0; } else { - m_pp.gold = m_pp.gold + tmp2; + m_pp.gold = (int32)(m_pp.gold + tmp2); } tmp-=tmp2*100; //if (updateclient) @@ -2193,11 +2193,11 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ // Add Amount of Silver tmp2 = tmp/10; - new_val = m_pp.silver + tmp2; + new_val = (int32)(m_pp.silver + tmp2); if(new_val < 0) { m_pp.silver = 0; } else { - m_pp.silver = m_pp.silver + tmp2; + m_pp.silver = (int32)(m_pp.silver + tmp2); } tmp-=tmp2*10; //if (updateclient) @@ -2212,7 +2212,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ if(new_val < 0) { m_pp.copper = 0; } else { - m_pp.copper = m_pp.copper + tmp2; + m_pp.copper = (int32)(m_pp.copper + tmp2); } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 9927c7e68..81465f2f6 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9798,7 +9798,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) cp/=10; m_pp.gold=cp%10; cp/=10; - m_pp.platinum=cp; + m_pp.platinum=(int32)cp; cp = static_cast(m_pp.copper_bank) + (static_cast(m_pp.silver_bank) * 10) + @@ -9811,7 +9811,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) cp/=10; m_pp.gold_bank=cp%10; cp/=10; - m_pp.platinum_bank=cp; + m_pp.platinum_bank=(int32)cp; bc->copper=m_pp.copper; bc->silver=m_pp.silver; diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 2960d5d08..4a4618045 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1528,14 +1528,14 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) // now we actually take it from the from bucket. if there's an error // with the destination slot, they lose their money - *from_bucket -= amount_to_take; + *from_bucket = (int32)(*from_bucket - amount_to_take); // why are intentionally inducing a crash here rather than letting the code attempt to stumble on? // assert(*from_bucket >= 0); if(to_bucket) { if(*to_bucket + amount_to_add > *to_bucket) // overflow check - *to_bucket += amount_to_add; + *to_bucket = (int32)(*to_bucket+amount_to_add); //shared bank plat if (RuleB(Character, SharedBankPlat)) @@ -1573,7 +1573,7 @@ void Client::OPMoveCoin(const EQApplicationPacket* app) tcs->slot = mc->cointype2; tcs->unknown5 = 0x4fD2; tcs->unknown7 = 0; - tcs->amount = amount_to_add; + tcs->amount = (uint32)amount_to_add; recipient->QueuePacket(outapp); safe_delete(outapp); }