mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
Work in progress on BattleAI. Related changes:
* battle AIs receive ptr to CBattleCallback (not sure why it was CPlayerBattleCallback, likely mistake) * reworked some battle callback methods to be more generic and able to handle some hypothetic scenarios * for testing purposes in duel mode the first AI will be taken fro mconfig and the second will remain stupid ai * minor changes
This commit is contained in:
@ -387,7 +387,10 @@ void CClient::newGame( CConnection *con, StartInfo *si )
|
||||
{
|
||||
auto cbc = make_shared<CBattleCallback>(gs, color, this);
|
||||
battleCallbacks[color] = cbc;
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI("StupidAI");
|
||||
if(!color)
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI(settings["server"]["neutralAI"].String());
|
||||
else
|
||||
battleints[color] = CDynLibHandler::getNewBattleAI("StupidAI");
|
||||
battleints[color]->init(cbc.get());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user