---------------------------------------------------------------
MODIFICATION A
---------------------------------------------------------------
reg A_Test A_TEST;
// Class A_Test from modification A
class A_Test
{
void OnEvent( EventType v_EventType, Param v_Params )
{
if ( v_EventType == ChatMessageEventTypeID )
{
ChatCommand( v_Params );
}
}
void ChatCommand( Param v_Params )
{
}
}
// modded class MissionServer from modification A
modded class MissionServer
{
override void OnInit()
{
super.OnInit();
A_TEST = new A_TEST();
}
override void OnEvent( EventType eventTypeId, Param params )
{
super.OnEvent( eventTypeId, params );
if ( A_TEST )
{
A_TEST.OnEvent( eventTypeId, params );
}
}
}
---------------------------------------------------------------
MODIFICATION B
---------------------------------------------------------------
// Class ChatCommand from modification B
class ChatCommand
{
void ChatCommand( string v_String )
{
}
}
---------------------------------------------------------------
Separately, both modifications will work correctly.
If you connect both modifications, you see error message:
Cannot convert 'Param' to 'string' for argument '0' to method 'ChatCommand'
line:
ChatCommand( v_Params );
```
reg A_Test A_TEST;
// Class A_Test from modification A
class A_Test
{
void OnEvent( EventType v_EventType, Param v_Params )
{
if ( v_EventType == ChatMessageEventTypeID )
{
ChatCommand( v_Params );
}
}
void ChatCommand( Param v_Params )
{
}
}
// modded class MissionServer from modification A
modded class MissionServer
{
override void OnInit()
{
super.OnInit();
A_TEST = new A_TEST();
}
override void OnEvent( EventType eventTypeId, Param params )
{
super.OnEvent( eventTypeId, params );
if ( A_TEST )
{
A_TEST.OnEvent( eventTypeId, params );
}
}
}
```
---------------------------------------------------------------
MODIFICATION B
---------------------------------------------------------------
```
// Class ChatCommand from modification B
class ChatCommand
{
void ChatCommand( string v_String )
{
}
}
```
---------------------------------------------------------------
Separately, both modifications will work correctly.
If you connect both modifications, you see error message:
Cannot convert 'Param' to 'string' for argument '0' to method 'ChatCommand'
line:
**ChatCommand( v_Params );**
Must call a class procedure, from A_Test
But in fact, it calls the class constructor, which is strange - even without an operator "new"