Skip to content

Commit

Permalink
Added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBitz committed Aug 22, 2021
1 parent 42af1aa commit 472e35b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion vSRO-GameServer/AppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ DWORD WINAPI AppManager::DatabaseFetchThread()
actionResult = FETCH_ACTION_STATE::CHARNAME_NOT_FOUND;
}
} break;
case 19:
case 19: // Reduce HP/MP from player
{
SQLINTEGER cParam02, cParam03, cParam04;
if (m_dbLink.sqlCmd.GetData(5, SQL_C_LONG, &cParam02, 0, NULL)
Expand Down
6 changes: 3 additions & 3 deletions vSRO-GameServer/Silkroad/Object/CGObjPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ void CGObjPC::UpdateSP(int32_t Offset)
void CGObjPC::ReduceHPMP(uint32_t Health, uint32_t Mana, bool ShowEffect)
{
// Check if player will die by health reduction
bool died = Health > m_CInstancePC->CurHealth;
bool died = Health > m_CInstancePC->Health;
if (died)
{
Health = m_CInstancePC->CurHealth;
Mana = m_CInstancePC->CurMana;
Health = m_CInstancePC->Health;
Mana = m_CInstancePC->Mana;
}
CallVirtual<void(__thiscall*)(CGObjPC*, uint32_t, uint32_t, uint16_t)>(this, 194)(this, Health, Mana, ShowEffect ? 1024 : 0);
// Set dead status
Expand Down
10 changes: 7 additions & 3 deletions vSRO-GameServer/Silkroad/Object/CInstancePC.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>

// Contains the basic informacion from player character
class CInstancePC
{
public:
Expand All @@ -9,7 +10,8 @@ class CInstancePC
char pad_0014[4]; //0x0014
uint32_t RefObjCharPtr; //0x0018
char pad_001C[4]; //0x001C
uint32_t CharID; //0x0020
// ID to identify the player from database
uint32_t CharID;
char pad_0024[4]; //0x0024
uint32_t ModelID; //0x0028
char pad_002C[4]; //0x002C
Expand All @@ -27,8 +29,10 @@ class CInstancePC
uint32_t RemainSkillPoint; //0x0080
uint32_t RemainStatPoint; //0x0084
char pad_0088[4]; //0x0088
uint32_t CurHealth; //0x008C
uint32_t CurMana; //0x0090
// Current health points
uint32_t Health;
// Current mana points
uint32_t Mana;
uint32_t RegionID; //0x0094
float PosX; //0x0098
float PosY; //0x009C
Expand Down

0 comments on commit 472e35b

Please sign in to comment.