View Issue Details

IDProjectCategoryView StatusLast Update
0000225Spring engineGeneralpublic2006-07-06 15:46
ReporterRafal99 Assigned Totvo  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Summary0000225: [Patch] Some additions and fixes to the AI interface
Description1. Adds PlayerCommandEvent to CGlobalAI::HandleEvent() function. It is called when player gives an order to units controlled by globalAI (when player shares com with an AI for example).

struct PlayerCommandEvent {
    std::vector<int> units;
    Command command;
    int player;
};
 
2. Adds AIVAL_SCRIPT_FILENAME to CGlobalAI::HandleEvent(). It gives AI's possibility to know name of script file if it is file other then script.txt. It will be useful for AI's which reads information about game setup from script file.

3. Fixes problem with CB->GetUnitPos(unit) called inside CGlobalAI::EnemyEnterRadar(unit) always giving 0 value. It happened because EnemyEnterRadar function was called before unit's radar status was being changed. So inside CGlobalAI::EnemyEnterRadar unit was still outside radar.

4. Fixes similar problem with CB->GetUnitDef(unit) inside CGlobalAI::EnemyEnterLOS(unit).

5. Fixes crash happening when globalAI dll tried to call CB->CreateGroup() (and probably other group commands). It happened because CGlobalAI::CGlobalAI() initializes callback before initializing gh (grouphandler), so callback->ai->gh stays being uninitialized.

6. Fixes error message "AI has modified spring components(possible cheat)" appearing when player tries to assign groupAI to units controlled by globalAI. Although i haven't tested it in multiplayer games with AI, so i am not sure if it won't still happen in that games.

Everythink was compiled and tested (but only in single player), so shouldn't cause problems.
TagsNo tags attached.
Attached Files
AiInterfaceFixes.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

tvo

2006-07-06 15:46

reporter   ~0000279

committed, thanks

Issue History

Date Modified Username Field Change
2006-07-02 00:12 Rafal99 New Issue
2006-07-02 00:13 Rafal99 File Added: AiInterfaceFixes.patch
2006-07-06 15:46 tvo Status new => resolved
2006-07-06 15:46 tvo Resolution open => fixed
2006-07-06 15:46 tvo Assigned To => tvo
2006-07-06 15:46 tvo Note Added: 0000279
2006-07-06 15:46 tvo Status resolved => assigned
2006-07-06 15:46 tvo Status assigned => resolved