Skip to content
Merged
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
20 changes: 18 additions & 2 deletions src/game/shared/neo/weapons/weapon_knife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,24 @@ bool CWeaponKnife::CanBePickedUpByClass(int classId)
#ifdef CLIENT_DLL
bool CWeaponKnife::ShouldDraw()
{
auto owner = static_cast<CNEO_Player*>(GetOwner());
return (owner && owner->IsAlive() && owner->GetActiveWeapon() == this);
const auto owner = static_cast<CNEO_Player*>(GetOwner());
const bool draw = (owner && owner->IsAlive() && owner->GetActiveWeapon() == this);
const bool noShadow = !draw;

// NEO HACK (Rain): should be moved to some more appropriate location
if (!!(GetEffects() & EF_NOSHADOW) != noShadow)
Comment thread
DESTROYGIRL marked this conversation as resolved.
{
if (draw) // DG: Disable shadows manually because it doesn't do it on its own
{
RemoveEffects(EF_NOSHADOW);
}
else
{
AddEffects(EF_NOSHADOW);
}
}

return draw;
}
#else
bool CWeaponKnife::IsViewable()
Expand Down