@@ -230,17 +230,14 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
230
230
if (!pWrapper)
231
231
{
232
232
REGISTER_NATIVE_ADDR (WEAPONDROP_GAMEDATA_NAME,
233
- PassInfo pass[3 ]; \
233
+ PassInfo pass[2 ]; \
234
234
pass[0 ].flags = PASSFLAG_BYVAL; \
235
235
pass[0 ].type = PassType_Basic; \
236
236
pass[0 ].size = sizeof (CBaseEntity *); \
237
237
pass[1 ].flags = PASSFLAG_BYVAL; \
238
238
pass[1 ].type = PassType_Basic; \
239
239
pass[1 ].size = sizeof (bool ); \
240
- pass[2 ].flags = PASSFLAG_BYVAL; \
241
- pass[2 ].type = PassType_Basic; \
242
- pass[2 ].size = sizeof (bool ); \
243
- pWrapper = g_pBinTools->CreateCall (addr, CallConv_ThisCall, NULL , pass, 3 ))
240
+ pWrapper = g_pBinTools->CreateCall (addr, CallConv_ThisCall, NULL , pass, 2 ))
244
241
}
245
242
246
243
CBaseEntity *pEntity;
@@ -273,16 +270,13 @@ static cell_t CS_DropWeapon(IPluginContext *pContext, const cell_t *params)
273
270
if (params[4 ] == 1 && g_pCSWeaponDropDetoured)
274
271
g_pIgnoreCSWeaponDropDetour = true ;
275
272
276
- unsigned char vstk[sizeof (CBaseEntity *) * 2 + sizeof (bool ) * 2 ];
273
+ unsigned char vstk[sizeof (CBaseEntity *) * 2 + sizeof (bool )];
277
274
unsigned char *vptr = vstk;
278
275
279
- // <psychonic> first one is always false. second is true to toss, false to just drop
280
276
*(CBaseEntity **)vptr = pEntity;
281
277
vptr += sizeof (CBaseEntity *);
282
278
*(CBaseEntity **)vptr = pWeapon;
283
279
vptr += sizeof (CBaseEntity *);
284
- *(bool *)vptr = false ;
285
- vptr += sizeof (bool );
286
280
*(bool *)vptr = (params[3 ]) ? true : false ;
287
281
288
282
pWrapper->Execute (vstk, NULL );
@@ -907,9 +901,9 @@ static cell_t CS_UpdateClientModel(IPluginContext *pContext, const cell_t *param
907
901
static cell_t CS_ItemDefIndexToID (IPluginContext *pContext, const cell_t *params)
908
902
{
909
903
#if SOURCE_ENGINE == SE_CSGO
910
- ItemIndexMap::Result res = g_mapDefIdxToClass.find ((uint16_t )params[1 ]);
911
-
912
- if (!res.found ())
904
+ ItemIndexMap::Result res = g_mapDefIdxToClass.find ((uint16_t )params[1 ]);
905
+
906
+ if (!res.found ())
913
907
return pContext->ThrowNativeError (" Invalid item definition passed." );
914
908
915
909
return res->value .m_iWeaponID ;
@@ -921,9 +915,9 @@ static cell_t CS_ItemDefIndexToID(IPluginContext *pContext, const cell_t *params
921
915
static cell_t CS_WeaponIDToItemDefIndex (IPluginContext *pContext, const cell_t *params)
922
916
{
923
917
#if SOURCE_ENGINE == SE_CSGO
924
- WeaponIDMap::Result res = g_mapWeaponIDToDefIdx.find ((SMCSWeapon)params[1 ]);
925
-
926
- if (!res.found ())
918
+ WeaponIDMap::Result res = g_mapWeaponIDToDefIdx.find ((SMCSWeapon)params[1 ]);
919
+
920
+ if (!res.found ())
927
921
return pContext->ThrowNativeError (" Invalid weapon id passed." );
928
922
929
923
return res->value .m_iDefIdx ;
0 commit comments