2025-11-29 21:23 CET

spring: develop e931a93d Diff ] Back to Repository ]
Author Committer Branch Timestamp Parent
tvo tvo develop 2006-07-06 15:44:48 develop 9baaa23f
Changeset * Apply patch by Rafal99, closes:225, this is what it does (copied from mantis):

 1. 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).

 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.

* Additionally, move WeaponFireEvent to IGlobalAI class.



git-svn-id: https://spring.clan-sy.com/svn/spring/trunk@1582 37977431-3df6-0310-b722-df95706aa16b
mod - rts/ExternalAI/AICallback.cpp Diff ] File ]
mod - rts/ExternalAI/GlobalAI.cpp Diff ] File ]
mod - rts/ExternalAI/GlobalAIHandler.cpp Diff ] File ]
mod - rts/ExternalAI/GlobalAIHandler.h Diff ] File ]
mod - rts/ExternalAI/IAICallback.h Diff ] File ]
mod - rts/ExternalAI/IGlobalAI.h Diff ] File ]
mod - rts/Game/GameSetup.cpp Diff ] File ]
mod - rts/Game/GameSetup.h Diff ] File ]
mod - rts/Game/SelectedUnits.cpp Diff ] File ]
mod - rts/Sim/Units/Unit.cpp Diff ] File ]