mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 02:08:23 +00:00
uint16 to uint8 explicit conversions
This commit is contained in:
+7
-7
@@ -2384,11 +2384,11 @@ bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
||||||
return(database.GetSkillCap(class_, skillid, level));
|
return(database.GetSkillCap((uint8)class_, skillid, (uint8)level));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Client::SkillTrainLevel(SkillUseTypes skillid, uint16 class_){
|
uint8 Client::SkillTrainLevel(SkillUseTypes skillid, uint16 class_){
|
||||||
return(database.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
|
return(database.GetTrainLevel((uint8)class_, skillid, RuleI(Character, MaxLevel)));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 maxSkill)
|
uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 maxSkill)
|
||||||
@@ -2576,10 +2576,10 @@ void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32
|
|||||||
LogText += Buffer;
|
LogText += Buffer;
|
||||||
|
|
||||||
if (buying==true) {
|
if (buying==true) {
|
||||||
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),merchant->GetName(),"Buying from Merchant",LogText.c_str(),2);
|
database.logevents(player->AccountName(),player->AccountID(),(uint8)player->admin,player->GetName(),merchant->GetName(),"Buying from Merchant",LogText.c_str(),2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),merchant->GetName(),"Selling to Merchant",LogText.c_str(),3);
|
database.logevents(player->AccountName(),player->AccountID(),(uint8)player->admin,player->GetName(),merchant->GetName(),"Selling to Merchant",LogText.c_str(),3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2604,7 +2604,7 @@ void Client::LogLoot(Client* player, Corpse* corpse, const Item_Struct* item){
|
|||||||
strcat(logtext,"(");
|
strcat(logtext,"(");
|
||||||
strcat(logtext,itemid);
|
strcat(logtext,itemid);
|
||||||
strcat(logtext,") Looted");
|
strcat(logtext,") Looted");
|
||||||
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Item",logtext,4);
|
database.logevents(player->AccountName(),player->AccountID(),(uint8)player->admin,player->GetName(),corpse->orgname,"Looting Item",logtext,4);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if ((corpse->GetPlatinum() + corpse->GetGold() + corpse->GetSilver() + corpse->GetCopper())>0) {
|
if ((corpse->GetPlatinum() + corpse->GetGold() + corpse->GetSilver() + corpse->GetCopper())>0) {
|
||||||
@@ -2613,9 +2613,9 @@ void Client::LogLoot(Client* player, Corpse* corpse, const Item_Struct* item){
|
|||||||
logtext=coinloot;
|
logtext=coinloot;
|
||||||
strcat(logtext," Looted");
|
strcat(logtext," Looted");
|
||||||
if (corpse->GetPlatinum()>10000)
|
if (corpse->GetPlatinum()>10000)
|
||||||
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Excessive Loot!",logtext,9);
|
database.logevents(player->AccountName(),player->AccountID(),(uint8)player->admin,player->GetName(),corpse->orgname,"Excessive Loot!",logtext,9);
|
||||||
else
|
else
|
||||||
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Money",logtext,5);
|
database.logevents(player->AccountName(),player->AccountID(),(uint8)player->admin,player->GetName(),corpse->orgname,"Looting Money",logtext,5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -331,7 +331,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
|
|||||||
uint8 myoldlevel = GetLevel();
|
uint8 myoldlevel = GetLevel();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetLevel(check_level);
|
SetLevel((uint8)check_level);
|
||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
if(RuleB(Bots, BotLevelsWithOwner))
|
if(RuleB(Bots, BotLevelsWithOwner))
|
||||||
|
|||||||
+1
-1
@@ -247,7 +247,7 @@ void HateList::DoFactionHits(int32 nfl_id) {
|
|||||||
p = nullptr;
|
p = nullptr;
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
p->SetFactionLevel(p->CharacterID(), nfl_id, p->GetBaseClass(), p->GetBaseRace(), p->GetDeity());
|
p->SetFactionLevel(p->CharacterID(), nfl_id, (uint8)p->GetBaseClass(), (uint8)p->GetBaseRace(), (uint8)p->GetDeity());
|
||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ uint32 Lua_Corpse::CountItems() {
|
|||||||
|
|
||||||
void Lua_Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
|
void Lua_Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->AddItem(itemnum, charges, slot, aug1, aug2, aug3, aug4, aug5);
|
self->AddItem(itemnum, (uint8)charges, slot, aug1, aug2, aug3, aug4, aug5);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Lua_Corpse::GetWornItem(int16 equipSlot) {
|
uint32 Lua_Corpse::GetWornItem(int16 equipSlot) {
|
||||||
|
|||||||
+1
-1
@@ -1233,7 +1233,7 @@ bool Merc::CanHaveSkill(SkillUseTypes skill_id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 Merc::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
uint16 Merc::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
|
||||||
return(database.GetSkillCap(class_, skillid, level));
|
return(database.GetSkillCap((uint8)class_, skillid, (uint8)level));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
void Merc::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||||
|
|||||||
+4
-4
@@ -1201,11 +1201,11 @@ void QuestManager::faction(int faction_id, int faction_value, int temp) {
|
|||||||
initiator->SetFactionLevel2(
|
initiator->SetFactionLevel2(
|
||||||
initiator->CharacterID(),
|
initiator->CharacterID(),
|
||||||
faction_id,
|
faction_id,
|
||||||
initiator->GetBaseClass(),
|
(uint8)initiator->GetBaseClass(),
|
||||||
initiator->GetBaseRace(),
|
(uint8)initiator->GetBaseRace(),
|
||||||
initiator->GetDeity(),
|
(uint8)initiator->GetDeity(),
|
||||||
faction_value,
|
faction_value,
|
||||||
temp);
|
(uint8)temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1818,8 +1818,8 @@ void Client::DoClassAttacks(Mob *ca_target, uint16 skill, bool IsRiposte)
|
|||||||
skill_to_use == SkillTigerClaw ||
|
skill_to_use == SkillTigerClaw ||
|
||||||
skill_to_use == SkillRoundKick)
|
skill_to_use == SkillRoundKick)
|
||||||
{
|
{
|
||||||
ReuseTime = MonkSpecialAttack(ca_target, skill_to_use) - 1;
|
ReuseTime = MonkSpecialAttack(ca_target, (uint8)skill_to_use) - 1;
|
||||||
MonkSpecialAttack(ca_target, skill_to_use);
|
MonkSpecialAttack(ca_target, (uint8)skill_to_use);
|
||||||
|
|
||||||
if (IsRiposte)
|
if (IsRiposte)
|
||||||
return;
|
return;
|
||||||
|
|||||||
+5
-5
@@ -152,7 +152,7 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id)
|
|||||||
if (with && with->IsClient()) {
|
if (with && with->IsClient()) {
|
||||||
with->SendItemPacket(dest_slot_id -IDX_TRADE,inst,ItemPacketTradeView);
|
with->SendItemPacket(dest_slot_id -IDX_TRADE,inst,ItemPacketTradeView);
|
||||||
if (inst->GetItem()->ItemClass == 1) {
|
if (inst->GetItem()->ItemClass == 1) {
|
||||||
for (uint16 i=0; i<10; i++) {
|
for (uint8 i=0; i<10; i++) {
|
||||||
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
|
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
|
||||||
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
|
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
|
||||||
if (bagitem) {
|
if (bagitem) {
|
||||||
@@ -266,7 +266,7 @@ void Trade::LogTrade()
|
|||||||
}
|
}
|
||||||
|
|
||||||
database.logevents(trader->AccountName(), trader->AccountID(),
|
database.logevents(trader->AccountName(), trader->AccountID(),
|
||||||
trader->Admin(), trader->GetName(), with->GetName(), "Trade", logtext, 6);
|
(uint8)trader->Admin(), trader->GetName(), with->GetName(), "Trade", logtext, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -597,7 +597,7 @@ void Client::FinishTrade(Mob* tradingWith, ServerPacket* qspack, bool finalizer)
|
|||||||
// pets need to look inside bags and try to equip items found there
|
// pets need to look inside bags and try to equip items found there
|
||||||
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
|
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
|
||||||
for(int16 bslot=0; bslot < item->BagSlots; bslot++) {
|
for(int16 bslot=0; bslot < item->BagSlots; bslot++) {
|
||||||
const ItemInst* baginst = inst->GetItem(bslot);
|
const ItemInst* baginst = inst->GetItem((uint8)bslot);
|
||||||
if (baginst) {
|
if (baginst) {
|
||||||
const Item_Struct* bagitem = baginst->GetItem();
|
const Item_Struct* bagitem = baginst->GetItem();
|
||||||
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsInstNoDrop() == false))) {
|
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsInstNoDrop() == false))) {
|
||||||
@@ -1006,7 +1006,7 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Cu
|
|||||||
_log(TRADING__CLIENT, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity);
|
_log(TRADING__CLIENT, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity);
|
||||||
if(Quantity < Charges) {
|
if(Quantity < Charges) {
|
||||||
Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber);
|
Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber);
|
||||||
m_inv.DeleteItem(Slot, Quantity);
|
m_inv.DeleteItem(Slot, (uint8)Quantity);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_TraderDelItem,sizeof(TraderDelItem_Struct));
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_TraderDelItem,sizeof(TraderDelItem_Struct));
|
||||||
@@ -1090,7 +1090,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client*
|
|||||||
_log(TRADING__CLIENT, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity);
|
_log(TRADING__CLIENT, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity);
|
||||||
}
|
}
|
||||||
if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){
|
if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){
|
||||||
this->DeleteItemInInventory(SlotID, Quantity);
|
this->DeleteItemInInventory(SlotID, (int8)Quantity);
|
||||||
|
|
||||||
TraderCharges_Struct* GetSlot = database.LoadTraderItemWithCharges(this->CharacterID());
|
TraderCharges_Struct* GetSlot = database.LoadTraderItemWithCharges(this->CharacterID());
|
||||||
|
|
||||||
|
|||||||
@@ -171,14 +171,14 @@ void WorldServer::Process() {
|
|||||||
if (!ZoneLoaded) break;
|
if (!ZoneLoaded) break;
|
||||||
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
|
ServerChannelMessage_Struct* scm = (ServerChannelMessage_Struct*) pack->pBuffer;
|
||||||
if (scm->deliverto[0] == 0) {
|
if (scm->deliverto[0] == 0) {
|
||||||
entity_list.ChannelMessageFromWorld(scm->from, scm->to, scm->chan_num, scm->guilddbid, scm->language, scm->message);
|
entity_list.ChannelMessageFromWorld(scm->from, scm->to, (uint8)scm->chan_num, scm->guilddbid, (uint8)scm->language, scm->message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Client* client;
|
Client* client;
|
||||||
client = entity_list.GetClientByName(scm->deliverto);
|
client = entity_list.GetClientByName(scm->deliverto);
|
||||||
if (client != 0) {
|
if (client != 0) {
|
||||||
if (client->Connected()) {
|
if (client->Connected()) {
|
||||||
client->ChannelMessageSend(scm->from, scm->to, scm->chan_num, scm->language, scm->message);
|
client->ChannelMessageSend(scm->from, scm->to, (uint8)scm->chan_num, (uint8)scm->language, scm->message);
|
||||||
if (!scm->noreply && scm->chan_num!=2) { //dont echo on group chat
|
if (!scm->noreply && scm->chan_num!=2) { //dont echo on group chat
|
||||||
// if it's a tell, echo back so it shows up
|
// if it's a tell, echo back so it shows up
|
||||||
scm->noreply = true;
|
scm->noreply = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user