Fixed bug where using vtable index 0 would cause call creation to fail
authorScott Ehlert <ds@alliedmods.net>
Thu Jul 05 20:17:08 2007 +0000 (2007-07-05)
changeset 1042a435a9c324df
parent 1041 f7b2073013df
child 1043 6e253ddd10c4
Fixed bug where using vtable index 0 would cause call creation to fail
extensions/sdktools/vcaller.cpp
     1.1 --- a/extensions/sdktools/vcaller.cpp	Thu Jul 05 14:47:36 2007 +0000
     1.2 +++ b/extensions/sdktools/vcaller.cpp	Thu Jul 05 20:17:08 2007 +0000
     1.3 @@ -38,7 +38,7 @@
     1.4  	SDKPass_ByRef,			/**< Pass an object by reference */
     1.5  };
     1.6  
     1.7 -int s_vtbl_index = 0;
     1.8 +int s_vtbl_index = -1;
     1.9  void *s_call_addr = NULL;
    1.10  ValveCallType s_vcalltype = ValveCall_Static;
    1.11  bool s_has_return = false;
    1.12 @@ -86,7 +86,7 @@
    1.13  static cell_t StartPrepSDKCall(IPluginContext *pContext, const cell_t *params)
    1.14  {
    1.15  	s_numparams = 0;
    1.16 -	s_vtbl_index = 0;
    1.17 +	s_vtbl_index = -1;
    1.18  	s_call_addr = NULL;
    1.19  	s_has_return = false;
    1.20  	s_vcalltype = (ValveCallType)params[1];
    1.21 @@ -202,7 +202,7 @@
    1.22  static cell_t EndPrepSDKCall(IPluginContext *pContext, const cell_t *params)
    1.23  {
    1.24  	ValveCall *vc = NULL;
    1.25 -	if (s_vtbl_index)
    1.26 +	if (s_vtbl_index > -1)
    1.27  	{
    1.28  		vc = CreateValveVCall(s_vtbl_index, s_vcalltype, s_has_return ? &s_return : NULL, s_params, s_numparams);
    1.29  	} else if (s_call_addr) {