diff --git a/db/src/PeerBase.cpp b/db/src/PeerBase.cpp index a037f9d..1e039d2 100644 --- a/db/src/PeerBase.cpp +++ b/db/src/PeerBase.cpp @@ -90,7 +90,7 @@ void CPeerBase::Encode(const void* data, size_t size) return; } - if(bufferevent_write(m_bufferevent, data, size) != 0) { + if (bufferevent_write(m_bufferevent, data, size) != 0) { sys_err("Buffer write error!"); return; } diff --git a/game/src/battle.cpp b/game/src/battle.cpp index 98bf17b..68a7d2b 100644 --- a/game/src/battle.cpp +++ b/game/src/battle.cpp @@ -22,8 +22,6 @@ #include "ani.h" #include "locale_service.h" -int battle_hit(LPCHARACTER ch, LPCHARACTER victim, int & iRetDam); - bool battle_distance_valid_by_xy(int x, int y, int tx, int ty) { int distance = DISTANCE_APPROX(x - tx, y - ty); @@ -161,9 +159,7 @@ int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim) const PIXEL_POSITION & vpos = victim->GetXYZ(); ch->SetRotationToXY(vpos.x, vpos.y); - int dam; - int ret = battle_hit(ch, victim, dam); - return (ret); + return battle_hit(ch, victim); } // ½ÇÁ¦ GET_BATTLE_VICTIMÀ» NULL·Î ¸¸µé°í À̺¥Æ®¸¦ ĵ½½ ½ÃŲ´Ù. @@ -633,12 +629,8 @@ void NormalAttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim) AttackAffect(pkAttacker, pkVictim, POINT_SLOW_PCT, IMMUNE_SLOW, AFFECT_SLOW, POINT_MOV_SPEED, -30, AFF_SLOW, 20, "SLOW"); } -int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int & iRetDam) +int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim) { - //PROF_UNIT puHit("Hit"); - if (test_server) - sys_log(0, "battle_hit : [%s] attack to [%s] : dam :%d type :%d", pkAttacker->GetName(), pkVictim->GetName(), iRetDam); - int iDam = CalcMeleeDamage(pkAttacker, pkVictim); if (iDam <= 0) @@ -684,7 +676,9 @@ int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int & iRetDam) float tempIDam = iDam; iDam = attMul * tempIDam + 0.5f; - iRetDam = iDam; + //PROF_UNIT puHit("Hit"); + if (test_server) + sys_log(0, "battle_hit : [%s] attack to [%s] : dam: %d", pkAttacker->GetName(), pkVictim->GetName(), iDam); //PROF_UNIT puDam("Dam"); if (pkVictim->Damage(pkAttacker, iDam, DAMAGE_TYPE_NORMAL)) diff --git a/game/src/battle.h b/game/src/battle.h index 89a45c1..d0d5ebc 100644 --- a/game/src/battle.h +++ b/game/src/battle.h @@ -28,6 +28,8 @@ extern int battle_count_attackers(LPCHARACTER ch); extern void NormalAttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim); +extern int battle_hit(LPCHARACTER ch, LPCHARACTER victim); + // Ư¼º °ø°Ý inline void AttackAffect(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, diff --git a/game/src/char.h b/game/src/char.h index c2ba563..4fe039f 100644 --- a/game/src/char.h +++ b/game/src/char.h @@ -1982,8 +1982,8 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider //µ¶ÀÏ ¼±¹° ±â´É ÆÐŶ Àӽà ÀúÀå private: - unsigned int itemAward_vnum; - char itemAward_cmd[20]; + unsigned int itemAward_vnum = 0; + char itemAward_cmd[20] = ""; //bool itemAward_flag; public: unsigned int GetItemAward_vnum() { return itemAward_vnum; }