Auto-translated
Perhaps it's not entirely on topic, but it's an important issue.
The other day, we encountered a problem in the "Mirrors-3" tournament. A plugin was written that bans heroes in taverns and prisons. After connecting it, if you open the map itself through the map editor, the checkboxes are not even set in its settings for the banned heroes. But the problem is that it only works correctly with non-mirror (regular) templates. However, on mirror templates, one or more banned heroes still appear on the map and in the map editor settings. The following heroes are banned: Gunnar, Dessa, Kirr, Luna, Galtran, Tant.
Is it possible to fix this problem? As far as I understand, the issue lies in Hw_ruless. We tried testing it on different templates and with different versions of Hw_Ruless.
Download the plugin.
CODE:
int __stdcall heroesBan(LoHook* h, HookContext* c)
{
for (int i = 0; i<156; i++)
{
if (deniedHeroes
== true)
{
o_pHeroInfo.allowed_in_not_roe = 0;
o_pHeroInfo.allowed_in_roe = 0;
}
}
}
...
_PI ->WriteLoHook (0x4EEA70, heroesBan);
===================================================
Raw insertion data:
int __stdcall heroesBan(LoHook* h, HookContext* c)
{
for (int i = 0; i<156; i++)
{
if(deniedHeroes== true)
{
o_pHeroInfo.allowed_in_not_roe = 0;
o_pHeroInfo.allowed_in_roe = 0;
}
}
}
...
_PI->WriteLoHook(0x4EEA70, heroesBan);