bot
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@25 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -35,6 +35,15 @@ void stop()
|
||||
demoloading = false;
|
||||
loopv(playerhistory) zapdynent(playerhistory[i]);
|
||||
playerhistory.setsize(0);
|
||||
// Added by Rick: Remove bots
|
||||
loopv(bots)
|
||||
{
|
||||
if (!bots[i]) continue;
|
||||
delete bots[i]->pBot;
|
||||
bots[i]->pBot = NULL;
|
||||
zapdynent(bots[i]);
|
||||
}
|
||||
bots.setsize(0);
|
||||
};
|
||||
|
||||
void stopifrecording() { if(demorecording) stop(); };
|
||||
@@ -105,17 +114,33 @@ void loadgamerest()
|
||||
{
|
||||
if(demoplayback || !f) return;
|
||||
|
||||
//Modified by Rick, MSVC 6.0 doesnt seem to like this
|
||||
//if(gzgeti()!=ents.length()) return loadgameout();
|
||||
if(gzgeti()!=ents.length()) { loadgameout(); return; }
|
||||
loopv(ents)
|
||||
{
|
||||
ents[i].spawned = gzgetc(f)!=0;
|
||||
if(ents[i].type==CARROT && !ents[i].spawned) trigger(ents[i].attr1, ents[i].attr2, true);
|
||||
if(ents[i].type==TRIGGER && !ents[i].spawned) trigger(ents[i].attr1, ents[i].attr2, true);
|
||||
};
|
||||
restoreserverstate(ents);
|
||||
|
||||
gzread(f, player1, sizeof(dynent));
|
||||
player1->lastaction = lastmillis;
|
||||
|
||||
int nmonsters = gzgeti();
|
||||
//dvector &monsters = getmonsters();
|
||||
//Modified by Rick, MSVC 6.0 doesnt seem to like this
|
||||
//if(nmonsters!=monsters.length()) return loadgameout();
|
||||
//if(nmonsters!=monsters.length()) { loadgameout(); return; }
|
||||
//loopv(monsters)
|
||||
//{
|
||||
//gzread(f, monsters[i], sizeof(dynent));
|
||||
//monsters[i]->enemy = player1; // lazy, could save id of enemy instead
|
||||
//monsters[i]->lastaction = monsters[i]->trigger = lastmillis+500; // also lazy, but no real noticable effect on game
|
||||
//if(monsters[i]->state==CS_DEAD) monsters[i]->lastaction = 0;
|
||||
//};
|
||||
//restoremonsterstate();
|
||||
|
||||
int nplayers = gzgeti();
|
||||
loopi(nplayers) if(!gzget())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user