Skip to content

Commit

Permalink
Fix to weapon stealing on snowfall elevator (#671)
Browse files Browse the repository at this point in the history
* raise initial weapon spawn position

* change absorigin to localorigin

* actually we don't care about parent of either object, idea is to place weapon on player regardless of the weapons or players parents so absolute position makes more sense

---------

Co-authored-by: brysondev <[email protected]>
  • Loading branch information
AdamTadeusz and brysondev authored Oct 12, 2024
1 parent 89465db commit bc3a767
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mp/src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,7 @@ void GiveDet(CNEO_Player* pPlayer)
}
else
{
pent->SetLocalOrigin(pPlayer->GetLocalOrigin());
pent->SetAbsOrigin(pPlayer->EyePosition());
pent->AddSpawnFlags(SF_NORESPAWN);

auto pWeapon = dynamic_cast<CNEOBaseCombatWeapon*>((CBaseEntity*)pent);
Expand Down Expand Up @@ -2434,7 +2434,7 @@ void CNEO_Player::GiveLoadoutWeapon(void)
return;
}

pEnt->SetLocalOrigin(GetLocalOrigin());
pEnt->SetAbsOrigin(EyePosition());
pEnt->AddSpawnFlags(SF_NORESPAWN);

CNEOBaseCombatWeapon *pNeoWeapon = dynamic_cast<CNEOBaseCombatWeapon*>((CBaseEntity*)pEnt);
Expand Down
7 changes: 5 additions & 2 deletions mp/src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5888,9 +5888,12 @@ CBaseEntity *CBasePlayer::GiveNamedItem( const char *pszName, int iSubType )
Msg( "NULL Ent in GiveNamedItem!\n" );
return NULL;
}

#ifdef NEO
pent->SetAbsOrigin(EyePosition());
#else
pent->SetLocalOrigin( GetLocalOrigin() );
pent->AddSpawnFlags(SF_NORESPAWN);
#endif
pent->AddSpawnFlags( SF_NORESPAWN );

CBaseCombatWeapon *pWeapon = dynamic_cast<CBaseCombatWeapon*>( (CBaseEntity*)pent );
if ( pWeapon )
Expand Down

0 comments on commit bc3a767

Please sign in to comment.