View Single Post
devilesk
Junior Member
Join Date: May 2019
Old 09-27-2020 , 16:16   Re: [L4D & L4D2] Left 4 DHooks Direct (1.23) [27-Sep-2020]
Reply With Quote #185

Quote:
Originally Posted by Silvers View Post
Looks like you've modified and used "include/l4d2_direct.inc". Left4Dhooks is based on that but has different code. So no changes will be made to this plugin.
I looked at your code and although it's different it still suffers from the same problem.

left4dhooks
Quote:
return LoadFromAddress(view_as<Address>(VersusModePt r + m_bTankThisRound + round), NumberType_Int;
l4d2_direct
Quote:
return bool:LoadFromAddress( L4D2Direct_GeVSTankToSpawnAddr() + Address:roundNumber , NumberType_Int8 );
The problem in both is that it's just using the round number and not taking into account which half it is and if teams are flipped.

I've also tested it using left4dhooks and confirmed that it's an issue. https://imgur.com/a/fZiNPaI

Test code used:
Quote:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <left4dhooks>

public Plugin:myinfo = {
name = "Round Tank Test",
author = "devilesk",
description = "Test tank spawn check functions.",
version = "1.0.0",
};

public OnPluginStart() {
RegConsoleCmd("sm_testtank", Command_Test);
}

public Action:Command_Test(client, args) {
PrintToChat(client, "InSecondHalfOfRound: %i", GameRules_GetProp("m_bInSecondHalfOfRound"));
PrintToChat(client, "AreTeamsFlipped: %i", GameRules_GetProp("m_bAreTeamsFlipped"));
PrintToChat(client, "1st Round Tank: %i", L4D2Direct_GetVSTankToSpawnThisRound(0));
PrintToChat(client, "2nd Round Tank: %i", L4D2Direct_GetVSTankToSpawnThisRound(1));

return Plugin_Handled;
}
I posted my fix for l4d2_direct as an example of the same fix that could be applied to your plugin.

Last edited by devilesk; 09-27-2020 at 16:21.
devilesk is offline