(svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.

NoAI is an API (a framework) to build your own AIs in. See:
   http://wiki.openttd.org/wiki/index.php/AI:Main_Page
 With many thanks to:
  - glx and Rubidium for their syncing, feedback and hard work
  - Yexo for his feedback, patches, and AIs which tested the system very deep
  - Morloth for his feedback and patches
  - TJIP for hosting a challenge which kept NoAI on track
  - All AI authors for testing our AI API, and all other people who helped in one way or another
-Remove: all old AIs and their cheats/hacks
This commit is contained in:
truebrain
2009-01-12 17:11:45 +00:00
parent 9294f96168
commit a3dd7506d3
257 changed files with 34620 additions and 7576 deletions

View File

@@ -39,6 +39,7 @@
#include "oldpool_func.h"
#include "animated_tile_func.h"
#include "effectvehicle_func.h"
#include "ai/ai.hpp"
#include "table/strings.h"
#include "table/sprites.h"
@@ -432,7 +433,10 @@ static CommandCost ClearTile_Industry(TileIndex tile, byte flags)
return_cmd_error(STR_4800_IN_THE_WAY);
}
if (flags & DC_EXEC) delete i;
if (flags & DC_EXEC) {
AI::BroadcastNewEvent(new AIEventIndustryClose(i->index));
delete i;
}
return CommandCost(EXPENSES_CONSTRUCTION, indspec->GetRemovalCost());
}
@@ -1712,6 +1716,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, uint32 flags, uint32 p1, uint32 p2,
SetDParam(1, ind->town->index);
}
AddNewsItem(indspec->new_industry_text, NS_INDUSTRY_OPEN, ind->xy, 0);
AI::BroadcastNewEvent(new AIEventIndustryOpen(ind->index));
}
return CommandCost(EXPENSES_OTHER, indspec->GetConstructionCost());
@@ -1912,8 +1917,8 @@ static void MaybeNewIndustry(void)
} else {
SetDParam(1, ind->town->index);
}
AddNewsItem(ind_spc->new_industry_text,
NS_INDUSTRY_OPEN, ind->xy, 0);
AddNewsItem(ind_spc->new_industry_text, NS_INDUSTRY_OPEN, ind->xy, 0);
AI::BroadcastNewEvent(new AIEventIndustryOpen(ind->index));
}
/**
@@ -2232,6 +2237,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly)
/* Compute news category */
if (closeit) {
ns = NS_INDUSTRY_CLOSE;
AI::BroadcastNewEvent(new AIEventIndustryClose(i->index));
} else {
switch (WhoCanServiceIndustry(i)) {
case 0: ns = NS_INDUSTRY_NOBODY; break;