From f43d3cd939f6f784b74863cf732b897893e20e52 Mon Sep 17 00:00:00 2001 From: Peter Balaz Date: Thu, 18 Sep 2025 15:33:42 +0200 Subject: [PATCH 1/2] CChar: added ResetVisualRange method To reset visual range in case supporting client versions before and after VisualRange support --- src/game/chars/CChar.cpp | 5 +++++ src/game/chars/CChar.h | 3 ++- src/game/clients/CClientMsg.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/chars/CChar.cpp b/src/game/chars/CChar.cpp index c712e956e..ea7ed578c 100644 --- a/src/game/chars/CChar.cpp +++ b/src/game/chars/CChar.cpp @@ -907,6 +907,11 @@ void CChar::SetVisualRange(byte newSight) } } +void CChar::ResetVisualRange() +{ + m_iVisualRange = g_Cfg.m_iMapViewSize; +} + // Clean up weird flags. // fix Weirdness. // NOTE: diff --git a/src/game/chars/CChar.h b/src/game/chars/CChar.h index 6f2c5eec0..191817f1c 100644 --- a/src/game/chars/CChar.h +++ b/src/game/chars/CChar.h @@ -383,8 +383,9 @@ public: void StatFlag_Mod(uint64 uiStatFlag, bool fMod) noexcept; CRegion * GetRoom() const; virtual int GetVisualRange() const override; void SetVisualRange(byte newSight); + void ResetVisualRange(); - virtual bool IsResourceMatch( const CResourceID& rid, dword dwArg ) const override; + virtual bool IsResourceMatch( const CResourceID& rid, dword dwArg ) const override; bool IsResourceMatch( const CResourceID& rid, dword dwArg, dword dwArgResearch ) const; bool IsSpeakAsGhost() const; diff --git a/src/game/clients/CClientMsg.cpp b/src/game/clients/CClientMsg.cpp index adfafa2e8..fd527e3bc 100644 --- a/src/game/clients/CClientMsg.cpp +++ b/src/game/clients/CClientMsg.cpp @@ -1470,6 +1470,7 @@ void CClient::addPlayerStart( CChar * pChar ) */ new PacketPlayerStart(this); + pChar->ResetVisualRange(); addMapDiff(); m_pChar->MoveToChar(pt, true, false, false, false); // make sure we are in active list m_pChar->Update(); From c21a4bae723ec0ab5b49bcc333f7bc066d172f35 Mon Sep 17 00:00:00 2001 From: Peter Balaz Date: Mon, 29 Sep 2025 18:11:21 +0200 Subject: [PATCH 2/2] chore(ci): empty commit to retrigger GitHub Actions