Skip to content

Commit 04c8af2

Browse files
committed
Added missing free_tr2() calls
1 parent c62c48b commit 04c8af2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

addons/amxmodx/scripting/parkour.sma

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#endif
88
99
#define PLUGIN "[Next21.ru] Parkour"
10-
#define VERSION "2.7 - Public test"
10+
#define VERSION "2.8"
1111
#define AUTHOR "Chrescoe1, Next21 Team"
1212
1313
@@ -154,9 +154,9 @@ new
154154
155155
_UpdateViewModel(const iPlayer)
156156
{
157-
pev(iPlayer,pev_viewmodel2,strUserModel,MODEL_V_STRLEN - 1);
157+
pev(iPlayer, pev_viewmodel2, strUserModel, charsmax(strUserModel));
158158
159-
if(!equal(strUserModel, MODEL_V))
159+
if (!equal(strUserModel, MODEL_V))
160160
{
161161
hasNewView[iPlayer] = true;
162162
pev(iPlayer, pev_viewmodel2, strViewModel[iPlayer], MODEL_V_STRLEN - 1);
@@ -271,6 +271,7 @@ _DropAllActions(const iPlayer)
271271
}
272272
}
273273
274+
274275
// Walljump action
275276
_setWallJump(const iPlayer, const iActiveItem)
276277
{
@@ -689,7 +690,6 @@ _Update_PK_Stats(const iPlayer)
689690
else
690691
if(iActiveItem)
691692
{
692-
693693
// In reloading
694694
if(get_pdata_int(iActiveItem, m_fInReload, extra_offset_weapon) == 1)
695695
{
@@ -1074,7 +1074,8 @@ stock UTIL_PlayWeaponAnim(const iPlayer, const iSequence, const bool: isForce)
10741074
message_end();
10751075
}
10761076
1077-
stock Float:UTIL_IsFreeHull(const Float:vecStart[3], const Float:vecEnd[3], const iEntity, checkType){
1077+
stock Float:UTIL_IsFreeHull(const Float:vecStart[3], const Float:vecEnd[3], const iEntity, checkType)
1078+
{
10781079
10791080
static iTr;
10801081
iTr = create_tr2();
@@ -1088,13 +1089,15 @@ stock Float:UTIL_IsFreeHull(const Float:vecStart[3], const Float:vecEnd[3], cons
10881089
{
10891090
if(flFraction >= 1.0)
10901091
{
1092+
free_tr2(iTr);
10911093
return 0.0;
10921094
}
10931095
10941096
static Float:vec3[3];
10951097
get_tr2(iTr,TR_vecPlaneNormal, vec3);
10961098
10971099
free_tr2(iTr);
1100+
10981101
if(checkType == CHECK_CLIMB)
10991102
{
11001103
if(vec3[2] < CHECKHULL_MINCLIMBNORMAL)
@@ -1113,8 +1116,10 @@ stock Float:UTIL_IsFreeHull(const Float:vecStart[3], const Float:vecEnd[3], cons
11131116
return 1.0;
11141117
}
11151118
}
1116-
1117-
free_tr2(iTr);
1119+
else
1120+
{
1121+
free_tr2(iTr);
1122+
}
11181123
11191124
return flFraction;
11201125
}

0 commit comments

Comments
 (0)