extensions/sdktools/vcallbuilder.cpp
changeset 1065 11756fc9fb63
parent 1031 d9cf44ddcd9c
child 1086 d03711b9593f
     1.1 --- a/extensions/sdktools/vcallbuilder.cpp	Sun Jul 08 09:34:20 2007 +0000
     1.2 +++ b/extensions/sdktools/vcallbuilder.cpp	Sun Jul 08 09:46:27 2007 +0000
     1.3 @@ -80,6 +80,8 @@
     1.4  
     1.5  	ValveCall *vc = new ValveCall;
     1.6  
     1.7 +	vc->type = vcalltype;
     1.8 +
     1.9  	size_t size = 0;
    1.10  	vc->stackSize = 0;
    1.11  
    1.12 @@ -109,16 +111,24 @@
    1.13  	{
    1.14  		thisinfo = &thisbuf;
    1.15  		thisinfo->type = PassType_Basic;
    1.16 -		if (vcalltype == ValveCall_Entity)
    1.17 +		switch (vcalltype)
    1.18  		{
    1.19 +		case ValveCall_Entity:
    1.20  			thisinfo->vtype = Valve_CBaseEntity;
    1.21 +			thisinfo->flags = PASSFLAG_BYVAL;
    1.22  			thisinfo->decflags |= VDECODE_FLAG_ALLOWWORLD;
    1.23 -		} else if (vcalltype == ValveCall_Player) {
    1.24 +			break;
    1.25 +		case ValveCall_Player:
    1.26  			thisinfo->vtype = Valve_CBasePlayer;
    1.27 +			thisinfo->flags = PASSFLAG_BYVAL;
    1.28 +			thisinfo->decflags = 0;
    1.29 +			break;
    1.30 +		case ValveCall_GameRules:
    1.31 +			thisinfo->vtype = Valve_POD;
    1.32 +			thisinfo->flags = PASSFLAG_ASPOINTER;
    1.33  			thisinfo->decflags = 0;
    1.34  		}
    1.35  		thisinfo->encflags = 0;
    1.36 -		thisinfo->flags = PASSFLAG_BYVAL;
    1.37  		thisinfo->offset = 0;
    1.38  		vc->stackSize += sizeof(void *);
    1.39  		cv = CallConv_ThisCall;
    1.40 @@ -227,6 +237,8 @@
    1.41  
    1.42  	ValveCall *vc = new ValveCall;
    1.43  
    1.44 +	vc->type = vcalltype;
    1.45 +
    1.46  	size_t size = 0;
    1.47  	vc->stackSize = 0;
    1.48  
    1.49 @@ -314,16 +326,25 @@
    1.50  	/* Save the this info for the dynamic decoder */
    1.51  	vc->thisinfo = &(vc->vparams[numParams + 1]);
    1.52  	vc->thisinfo->type = PassType_Basic;
    1.53 -	if (vcalltype == ValveCall_Entity)
    1.54 +	switch (vcalltype)
    1.55  	{
    1.56 +	case ValveCall_Entity:
    1.57  		vc->thisinfo->vtype = Valve_CBaseEntity;
    1.58 +		vc->thisinfo->flags = PASSFLAG_BYVAL;
    1.59  		vc->thisinfo->decflags = VDECODE_FLAG_ALLOWWORLD;
    1.60 -	} else if (vcalltype == ValveCall_Player) {
    1.61 +		break;
    1.62 +	case ValveCall_Player:
    1.63  		vc->thisinfo->vtype = Valve_CBasePlayer;
    1.64 +		vc->thisinfo->flags = PASSFLAG_BYVAL;
    1.65  		vc->thisinfo->decflags = 0;
    1.66 +		break;
    1.67 +	case ValveCall_GameRules:
    1.68 +		vc->thisinfo->vtype = Valve_POD;
    1.69 +		vc->thisinfo->flags = PASSFLAG_ASPOINTER;
    1.70 +		vc->thisinfo->decflags = 0;
    1.71 +		break;
    1.72  	}
    1.73  	vc->thisinfo->encflags = 0;
    1.74 -	vc->thisinfo->flags = PASSFLAG_BYVAL;
    1.75  	vc->thisinfo->offset = 0;
    1.76  	vc->thisinfo->obj_offset = 0;
    1.77  	normSize += sizeof(void *);