mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-06 00:32:25 +00:00
int32 explicit conversions
This commit is contained in:
parent
e9b88e2401
commit
b07d3ee5c6
@ -2578,7 +2578,7 @@ DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) {
|
||||
mysql_free_result(result);
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT spellid, type, minlevel, maxlevel, manacost, recast_delay, priority, resist_adjust from npc_spells_entries where npc_spells_id=%d ORDER BY minlevel", iDBSpellsID), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
uint32 tmpSize = sizeof(DBnpcspells_Struct) + (sizeof(DBnpcspells_entries_Struct) * mysql_num_rows(result));
|
||||
uint32 tmpSize = sizeof(DBnpcspells_Struct) + (sizeof(DBnpcspells_entries_Struct) * (uint32)mysql_num_rows(result));
|
||||
npc_spells_cache[iDBSpellsID] = (DBnpcspells_Struct*) new uchar[tmpSize];
|
||||
memset(npc_spells_cache[iDBSpellsID], 0, tmpSize);
|
||||
npc_spells_cache[iDBSpellsID]->parent_list = tmpparent_list;
|
||||
@ -2694,7 +2694,7 @@ DBnpcspellseffects_Struct* ZoneDatabase::GetNPCSpellsEffects(uint32 iDBSpellsEff
|
||||
mysql_free_result(result);
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT spell_effect_id, minlevel, maxlevel,se_base, se_limit, se_max from npc_spells_effects_entries where npc_spells_effects_id=%d ORDER BY minlevel", iDBSpellsEffectsID), errbuf, &result)) {
|
||||
safe_delete_array(query);
|
||||
uint32 tmpSize = sizeof(DBnpcspellseffects_Struct) + (sizeof(DBnpcspellseffects_entries_Struct) * mysql_num_rows(result));
|
||||
uint32 tmpSize = sizeof(DBnpcspellseffects_Struct) + (sizeof(DBnpcspellseffects_entries_Struct) * (uint32)mysql_num_rows(result));
|
||||
npc_spellseffects_cache[iDBSpellsEffectsID] = (DBnpcspellseffects_Struct*) new uchar[tmpSize];
|
||||
memset(npc_spellseffects_cache[iDBSpellsEffectsID], 0, tmpSize);
|
||||
npc_spellseffects_cache[iDBSpellsEffectsID]->parent_list = tmpparent_list;
|
||||
|
||||
@ -2100,7 +2100,7 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pp.copper = copperpp;
|
||||
m_pp.copper = (int32)copperpp;
|
||||
if(updateclient)
|
||||
SendMoneyUpdate();
|
||||
Save();
|
||||
@ -2114,8 +2114,8 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pp.silver = silver/10;
|
||||
m_pp.copper += (silver-(m_pp.silver*10));
|
||||
m_pp.silver = (int32)(silver/10);
|
||||
m_pp.copper = (int32)(m_pp.copper + silver-(m_pp.silver*10));
|
||||
if(updateclient)
|
||||
SendMoneyUpdate();
|
||||
Save();
|
||||
@ -2131,7 +2131,7 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) {
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pp.gold = gold/100;
|
||||
m_pp.gold = (int32)(gold/100);
|
||||
uint64 silvertest = (gold-(static_cast<uint64>(m_pp.gold)*100))/10;
|
||||
m_pp.silver =(int32)(m_pp.silver + silvertest);
|
||||
uint64 coppertest = (gold-(static_cast<uint64>(m_pp.gold)*100+silvertest*10));
|
||||
@ -2146,11 +2146,11 @@ bool Client::TakeMoneyFromPP(uint64 copper, bool updateclient) {
|
||||
|
||||
//Impossible for plat to be negative, already checked above
|
||||
|
||||
m_pp.platinum = platinum/1000;
|
||||
m_pp.platinum = (int32)(platinum/1000);
|
||||
uint64 goldtest = (platinum-(static_cast<uint64>(m_pp.platinum)*1000))/100;
|
||||
m_pp.gold = (int32)(m_pp.gold +goldtest);
|
||||
uint64 silvertest = (platinum-(static_cast<uint64>(m_pp.platinum)*1000+goldtest*100))/10;
|
||||
m_pp.silver += silvertest;
|
||||
m_pp.silver = (int32)(m_pp.silver+ silvertest);
|
||||
uint64 coppertest = (platinum-(static_cast<uint64>(m_pp.platinum)*1000+goldtest*100+silvertest*10));
|
||||
m_pp.copper = (int32)coppertest;
|
||||
if(updateclient)
|
||||
|
||||
@ -1308,7 +1308,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3
|
||||
}
|
||||
safe_delete_array(query);
|
||||
|
||||
uint32 resultRowTotal = mysql_num_rows(result);
|
||||
uint32 resultRowTotal = (uint32)mysql_num_rows(result);
|
||||
|
||||
if(resultRowTotal == 0) { //Recipe contents matched more than 1 recipe, but not in this container
|
||||
LogFile->write(EQEMuLog::Error, "Combine error: Incorrect container is being used!");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user