Skip to content

MsgFunc_CurWeapon and MsgFunc_WeaponList #339

Description

@GLoOoccK

The current implementation appears to be missing part of the behavior present in the original Half-Life SDK implementation.

https://github.com/Velaron/cs16-client/blob/main/cl_dll/ammo.cpp#L576-L660
https://github.com/ValveSoftware/halflife/blob/master/cl_dll/ammo.cpp#L568-L700

Missing in several parts of the code:
SetCrosshair

if ( gHUD.m_iFOV >= 90 )
{ // normal crosshairs
	if (fOnTarget && m_pWeapon->hAutoaim)
		SetCrosshair(m_pWeapon->hAutoaim, m_pWeapon->rcAutoaim, 255, 255, 255);
	else
		SetCrosshair(m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255);
}
else
{ // zoomed crosshairs
	if (fOnTarget && m_pWeapon->hZoomedAutoaim)
		SetCrosshair(m_pWeapon->hZoomedAutoaim, m_pWeapon->rcZoomedAutoaim, 255, 255, 255);
	else
		SetCrosshair(m_pWeapon->hZoomedCrosshair, m_pWeapon->rcZoomedCrosshair, 255, 255, 255);
}

The issue becomes noticeable when the message is triggered manually while using a modified FOV.

MESSAGE_BEGIN( MSG_ONE, gmsgCurWeapon, NULL, pPlayer->pev );

In this scenario, the crosshair behavior does not match the original implementation and is handled incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions