I am encountering a very strange issue with the compilation of plugins. This could be a simple mistake on my end, but I am very confused. First, let me show you my code:
PHP Code:
#include <sourcemod>
#include <tf2>
ConVar g_Cvar_Test[view_as<int>(TFTeam)][view_as<int>(TFClassType)];
Handle g_hTest[view_as<int>(TFTeam)][view_as<int>(TFClassType)];
int g_iTest[view_as<int>(TFTeam)][view_as<int>(TFClassType)];
public void OnPluginStart()
{
// Testing with ConVars
g_Cvar_Test[2][1] = CreateConVar("sm_cvar_test", "1", "Test"); // Works
g_Cvar_Test[view_as<int>(TFTeam_Red)][1] = CreateConVar("sm_cvar_test2", "1", "Test"); // Works
g_Cvar_Test[view_as<int>(TFTeam_Red)][view_as<int>(TFClass_Scout)] = CreateConVar("sm_cvar_test3", "1", "Test"); // warning 213: tag mismatch
// Testing with handles
g_hTest[2][1] = CreateArray(); // Works
g_hTest[view_as<int>(TFTeam_Red)][1] = CreateArray(); // Works
g_hTest[view_as<int>(TFTeam_Red)][view_as<int>(TFClass_Scout)] = CreateArray(); // warning 213: tag mismatch
// Testing with integers
g_iTest[2][1] = 1; // Works
g_iTest[view_as<int>(TFTeam_Red)][1] = 1; // Works
g_iTest[view_as<int>(TFTeam_Red)][view_as<int>(TFClass_Scout)] = 1; // Works
}
As you can see, I am attempting to assign certain values to multi-dimensional arrays. However, I encountered a very strange behavior when it comes to handles. For some reason, when I attempt to index the second set of brackets with, for example:
Code:
view_as<int>(TFClass_Scout)
It gives me this warning:
Code:
warning 213: tag mismatch
However, if I use a normal integer, it works completely fine. The weirdest part is that this warning does not occur when I attempt to do it with the integer based array. Why is this?