diff --git a/AMBuildScript b/AMBuildScript index de4320d3..7aa9ed53 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -66,11 +66,11 @@ SDKMap = { 'mcv': SDK('HL2SDKMCV', '2.mcv', '22', 'MCV', WinOnly, 'mcv'), 'csgo': SDK('HL2SDKCSGO', '2.csgo', '23', 'CSGO', CSGO, 'csgo'), 'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '18', 'PORTAL2', [], 'portal2'), - 'blade': SDK('HL2SDKBLADE', '2.blade', '19', 'BLADE', Blade, 'blade'), - 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '20', 'INSURGENCY', WinLinuxMac, 'insurgency'), + 'blade': SDK('HL2SDKBLADE', '2.blade', '21', 'BLADE', Blade, 'blade'), + 'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'), 'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '15', 'CONTAGION', WinOnly, 'contagion'), 'bms': SDK('HL2SDKBMS', '2.bms', '11', 'BMS', WinLinux, 'bms'), - 'doi': SDK('HL2SDKDOI', '2.doi', '21', 'DOI', WinLinuxMac, 'doi'), + 'doi': SDK('HL2SDKDOI', '2.doi', '20', 'DOI', WinLinuxMac, 'doi'), 'mock': SDK('HL2SDK-MOCK', '2.mock', '999', 'MOCK', Mock, 'mock'), 'pvkii': SDK('HL2SDKPVKII', '2.pvkii', '10', 'PVKII', WinLinux, 'pvkii'), } diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 50b5a9a6..3f16755d 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -476,11 +476,19 @@ static cell_t TeleportEntity(IPluginContext *pContext, const cell_t *params) static ValveCall *pCall = NULL; if (!pCall) { - ValvePassInfo pass[3]; +#if SOURCE_ENGINE >= SE_PORTAL2 + constexpr size_t paramCount = 4; +#else + constexpr size_t paramCount = 3; +#endif + ValvePassInfo pass[paramCount]; InitPass(pass[0], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL, VDECODE_FLAG_ALLOWNULL); InitPass(pass[1], Valve_QAngle, PassType_Basic, PASSFLAG_BYVAL, VDECODE_FLAG_ALLOWNULL); InitPass(pass[2], Valve_Vector, PassType_Basic, PASSFLAG_BYVAL, VDECODE_FLAG_ALLOWNULL); - if (!CreateBaseCall("Teleport", ValveCall_Entity, NULL, pass, 3, &pCall)) +#if SOURCE_ENGINE >= SE_PORTAL2 + InitPass(pass[3], Valve_Bool, PassType_Basic, PASSFLAG_BYVAL); +#endif + if (!CreateBaseCall("Teleport", ValveCall_Entity, NULL, pass, paramCount, &pCall)) { return pContext->ThrowNativeError("\"Teleport\" not supported by this mod"); } else if (!pCall) { @@ -493,6 +501,11 @@ static cell_t TeleportEntity(IPluginContext *pContext, const cell_t *params) DECODE_VALVE_PARAM(2, vparams, 0); DECODE_VALVE_PARAM(3, vparams, 1); DECODE_VALVE_PARAM(4, vparams, 2); + +#if SOURCE_ENGINE >= SE_PORTAL2 + *(bool *)(vptr + pCall->vparams[3].offset) = true; +#endif + FINISH_CALL_SIMPLE(NULL); return 1;