1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 01:47:39 +00:00

more fixes to multiplayer

This commit is contained in:
Zeno Rogue
2021-03-06 11:46:13 +01:00
parent 032a6b6df2
commit 40d450676e
15 changed files with 97 additions and 92 deletions

View File

@@ -797,7 +797,7 @@ EX void handleInput(int delta) {
}
EX void checklastmove() {
for(int i=0; i<numplayers(); i++) if(playerActive(i)) {
for(int i: player_indices()) {
multi::cpid = i;
cwt = multi::player[i]; break;
}
@@ -824,7 +824,7 @@ EX void handleInput(int delta) {
multi::player[0] = cwt;
}
for(int i=0; i<numplayers(); i++) if(playerActive(i)) {
for(int i: player_indices()) {
using namespace multi;
@@ -908,13 +908,13 @@ EX void handleInput(int delta) {
// check for crashes
needinput = true;
for(int i=0; i<numplayers(); i++) if(playerActive(i)) {
for(int i: player_indices()) {
origpos[i] = player[i].at;
origtarget[i] = multiPlayerTarget(i);
}
for(int i=0; i<numplayers(); i++) if(playerActive(i))
for(int j=0; j<numplayers(); j++) if(playerActive(j)) if(i != j) {
for(int i: player_indices())
for(int j: player_indices()) if(i != j) {
if(origtarget[i] == origtarget[j]) {
addMessage("Two players cannot move/attack the same location!");
return;