1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

* a bit better stack reversing

* FoWChange uses unordered_set instead of set
This commit is contained in:
mateuszb
2011-01-20 17:25:15 +00:00
parent 898ad292ea
commit 2451c0dea6
16 changed files with 106 additions and 64 deletions

View File

@ -1,4 +1,5 @@
#include "stdafx.h"
#include "../int3.h"
#include "../lib/CCampaignHandler.h"
#include "../StartInfo.h"
#include "../lib/CArtHandler.h"
@ -3405,11 +3406,15 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message )
FoWChange fc;
fc.mode = 1;
fc.player = player;
int3 * hlp_tab = new int3[gs->map->width * gs->map->height * (gs->map->twoLevel + 1)];
int lastUnc = 0;
for(int i=0;i<gs->map->width;i++)
for(int j=0;j<gs->map->height;j++)
for(int k=0;k<gs->map->twoLevel+1;k++)
if(!gs->getPlayerTeam(fc.player)->fogOfWarMap[i][j][k])
fc.tiles.insert(int3(i,j,k));
hlp_tab[lastUnc++] = int3(i,j,k);
fc.tiles.insert(hlp_tab, hlp_tab + lastUnc);
delete [] hlp_tab;
sendAndApply(&fc);
}
else if(message == "vcmiglorfindel") //selected hero gains a new level