Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sh_character_cosmetics.nut #122

Closed
wants to merge 3 commits into from

Conversation

ttvmkos
Copy link
Collaborator

@ttvmkos ttvmkos commented Mar 20, 2024

Setting the camo to 0 generates an invalid range.

Therefore, when the skin is invalid, the fallback should not be an index of 0, but the index of the current camo instead.

Setting the camo to 0 generates an invalid range. 

Therefore, when the skin is invalid, the fallback should not be an index of 0, but the index of the current camo instead.
If a function call this on an ent that is not a player, there is a crash. Solution: Handle within function, or require function caller to check if is player before calling.
If a function call this on an ent that is not a player, there is a crash. Solution: Handle within function, or require function caller to check if is player before calling.


See:


[8280.603] Native(E):CHostState::FrameUpdate: Shutdown host game
[8280.604] Script(S):SCRIPT ERROR: [SERVER] Entity class "CScriptTraceVolume" doesn't match required class for this index or function call
[8280.604] Script(S): -> player.p.disableOffhandWeaponsStackCount--
[8280.604] Script(S):
CALLSTACK
*FUNCTION [EnableOffhandWeapons()] _utility.gnut line [3654]
*FUNCTION [forbiddenZone_leave()] gamemodes/fs_1v1/_gamemode_1v1.nut line [1139]

[8280.604] Script(S):LOCALS
[player] ENTITY (trace_volume bangalore_smokescreen [381] at <-4631.56 -2437.88 315.406>)




Many functions in utility also already perform this check.
@ttvmkos
Copy link
Collaborator Author

ttvmkos commented Mar 21, 2024

I chose to change it at call:

void function forbiddenZone_leave(entity trigger , entity ent)

{
	if( !IsValid(ent) || !ent.IsPlayer() ) return
	EnableOffhandWeapons(ent)
	DeployAndEnableWeapons( ent )
	EntityBackInBounds( trigger, ent, null, null )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants