Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void command_and_not_die(const vector<int>& W , Pos p, int id, const Dir& dir)
- {
- if (S[id].empty()) return;
- int ai, aj;
- calculate(S[id].top(), ai, aj);
- Pos newmov = {ai, aj};
- newmov += dir;
- if (not pos_ok(newmov)) command_and_not_die(W, p, id, progress(dir));
- else if (check_others(W, id))
- {
- if (unit(id).type == Car and cell(newmov).type == City) command_and_not_die(W, p, id, progress(dir));
- else if ((cell(newmov).id != -1 and unit(cell(ai, aj).id).player != me()) or (cell(newmov).type != Desert
- or cell(newmov).type != Road or cell(newmov).type != City)) command_and_not_die(W, p, id, progress(dir));
- else
- {
- //Because I have'd to modify the route
- Priority[id] = false;
- InRoute[id] = false;
- Attack[id] = false;
- command(id, dir);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement