Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/nanodbc
2 changes: 1 addition & 1 deletion deps/zlib
Submodule zlib updated 111 files
12 changes: 6 additions & 6 deletions src/Client/WarFare/GameDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,11 @@ struct __InfoPlayerOther
int iFace; // Face type
int iHair; // Hair type

int iCity; // Affiliated city
std::string szKnights; // Clan name
int iKnightsGrade; // Clan grade
int iKnightsRank; // Clan ranking
int iCity; // Affiliated city
std::string szKnights; // Clan name
int iKnightsGrade; // Clan grade
int iKnightsRank; // Clan ranking
e_KnightsDuty eKnightsDuty; // Clan role/duty

int iRank; // Noble rank - used to identify high-ranking titles like King [1], Senator [2].
int iTitle; // Bitmask representing various titles/roles including:
Expand All @@ -443,6 +444,7 @@ struct __InfoPlayerOther
iCity = 0;
iKnightsGrade = 0;
iKnightsRank = 0;
eKnightsDuty = KNIGHTS_DUTY_UNKNOWN;
iTitle = 0;

szKnights.clear();
Expand All @@ -467,7 +469,6 @@ struct __InfoPlayerMySelf : public __InfoPlayerOther
int64_t iExp;
int iRealmPoint; // National Points
int iRealmPointMonthly; // Monthly National Points
e_KnightsDuty eKnightsDuty; // Clan member position/role/duty
int iWeightMax; // Max weight
int iWeight; // Current weight
int iStrength; // Strength
Expand Down Expand Up @@ -529,7 +530,6 @@ struct __InfoPlayerMySelf : public __InfoPlayerOther
iExp = 0;
iRealmPoint = 0;
iRealmPointMonthly = 0;
eKnightsDuty = KNIGHTS_DUTY_UNKNOWN;
iWeightMax = 0;
iWeight = 0;
iStrength = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/Client/WarFare/GameProcMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2538,7 +2538,7 @@ bool CGameProcMain::MsgRecv_UserIn(Packet& pkt, bool bWithFX)

// 기사단 관련
int iKnightsID = pkt.read<int16_t>(); // 기사단 ID
/*e_KnightsDuty eKnightsDuty = (e_KnightsDuty)*/ pkt.read<uint8_t>(); // 소속 국가. 0 이면 없다. 1
e_KnightsDuty eKnightsDuty = (e_KnightsDuty) pkt.read<uint8_t>(); // 소속 국가. 0 이면 없다. 1

/*int16_t sAllianceID =*/pkt.read<int16_t>();

Expand Down Expand Up @@ -2632,6 +2632,7 @@ bool CGameProcMain::MsgRecv_UserIn(Packet& pkt, bool bWithFX)
pUPC->Init(eRace, iFace, iHair, dwItemIDs, iItemDurabilities, byItemFlags);
pUPC->RotateTo(DegreesToRadians(rand() % 360), true);
pUPC->KnightsInfoSet(iKnightsID, szKnightsName, iKnightsGrade, iKnightsRank);
pUPC->m_InfoExt.eKnightsDuty = eKnightsDuty;

//__KnightsInfoBase* pKIB = m_pUIKnightsOp->KnightsInfoFind(iKightsID);
//if(pKIB) pUPC->KnightsNameSet(pKIB->szName, 0xffff0000);
Expand Down
27 changes: 27 additions & 0 deletions src/Client/WarFare/PlayerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,33 @@
m_pIDFont->DrawText(pt.x - (size.cx / 2.0f) + 1.0f, pt.y + 1.0f, 0xff000000, 0);
m_pIDFont->DrawText(pt.x - (size.cx / 2.0f) + 0.0f, pt.y + 0.0f, crFont, 0);

// Draw green line under name if clan leader
if (KnightsDuty() == KNIGHTS_DUTY_CHIEF)
{
SIZE nameSize = m_pIDFont->GetSize();
float fLeft = static_cast<float>(pt.x - (nameSize.cx / 2));

Check failure on line 868 in src/Client/WarFare/PlayerBase.cpp

View workflow job for this annotation

GitHub Actions / Debug - x64 (Windows)

src/Client/WarFare/PlayerBase.cpp:868:68 [bugprone-integer-division]

result of integer division used in a floating point context; possible loss of precision
float fRight = static_cast<float>(pt.x + (nameSize.cx / 2));

Check failure on line 869 in src/Client/WarFare/PlayerBase.cpp

View workflow job for this annotation

GitHub Actions / Debug - x64 (Windows)

src/Client/WarFare/PlayerBase.cpp:869:68 [bugprone-integer-division]

result of integer division used in a floating point context; possible loss of precision
float fTop = static_cast<float>(pt.y + nameSize.cy + 1);
float fBottom = static_cast<float>(pt.y + nameSize.cy + 2);

__VertexTransformedColor vLine[4] = {
{ fLeft, fTop, 0.0f, 1.0f, 0xff00ff00 },
{ fRight, fTop, 0.0f, 1.0f, 0xff00ff00 },
{ fRight, fBottom, 0.0f, 1.0f, 0xff00ff00 },
{ fLeft, fBottom, 0.0f, 1.0f, 0xff00ff00 },
};

DWORD dwPrevFVF;

Check failure on line 880 in src/Client/WarFare/PlayerBase.cpp

View workflow job for this annotation

GitHub Actions / Debug - x64 (Windows)

src/Client/WarFare/PlayerBase.cpp:880:11 [cppcoreguidelines-init-variables]

variable 'dwPrevFVF' is not initialized
s_lpD3DDev->GetFVF(&dwPrevFVF);

s_lpD3DDev->SetTexture(0, nullptr);
s_lpD3DDev->SetFVF(FVF_TRANSFORMEDCOLOR);
s_lpD3DDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vLine, sizeof(__VertexTransformedColor));

s_lpD3DDev->SetFVF(dwPrevFVF);
}


//Knight & clan 렌더링..
if (m_pClanFont && m_pClanFont->IsSetText())
{
Expand Down
4 changes: 4 additions & 0 deletions src/Client/WarFare/PlayerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class CPlayerBase : public CGameBase
e_StateAction m_eStateNext = PSA_BASIC; // 직전에 세팅된 행동 상태..
e_StateMove m_eStateMove = PSM_STOP; // 움직이는 상태..
e_StateDying m_eStateDying = PSD_UNKNOWN; // 죽을때 어떻게 죽는가..??
virtual e_KnightsDuty KnightsDuty() const
{
return KNIGHTS_DUTY_UNKNOWN;
}
float m_fTimeDying = 0.0f; // 죽는 모션을 취하는 시간..

__ColorValue m_cvDuration = { 1, 1, 1, 1 }; // 지속 컬러 값
Expand Down
5 changes: 5 additions & 0 deletions src/Client/WarFare/PlayerMySelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class CPlayerMySelf : public CPlayerBase
__Vector3 m_vTargetPos; // 이동할 지점 위치
void SetMoveTargetID(int iID);
void SetMoveTargetPos(const __Vector3& vPos);
e_KnightsDuty KnightsDuty() const override
{
return m_InfoExt.eKnightsDuty;
}


public:
void TargetOrPosMove();
Expand Down
4 changes: 4 additions & 0 deletions src/Client/WarFare/PlayerOther.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class CPlayerOther : public CPlayerNPC
public:
__InfoPlayerOther m_InfoExt; // 캐릭터 정보 확장..
bool m_bSit;
e_KnightsDuty KnightsDuty() const override
{
return m_InfoExt.eKnightsDuty;
}

public:
void InitFace() override;
Expand Down
Loading