Commit b02d2bc4 authored by nanahira's avatar nanahira

fix tag

parent dcf0155b
......@@ -1778,7 +1778,7 @@ int Game::LocalPlayer(int player) const {
int pid = player ? 1 : 0;
return dInfo.isFirst ? pid : 1 - pid;
}
int Game::OppositePlayer(int player) const {
int Game::OppositePlayer(int player) {
if(dInfo.isTag) {
if(player == 0)
return 2;
......@@ -1792,7 +1792,7 @@ int Game::OppositePlayer(int player) const {
} else
return 1 - player;
}
int Game::ChatLocalPlayer(int player) const {
int Game::ChatLocalPlayer(int player) {
if(player > 3)
return player;
bool is_self;
......@@ -1809,13 +1809,16 @@ int Game::ChatLocalPlayer(int player) const {
if(dInfo.isTag) {
is_self = (player & 0x2) == 0 && (player & 0x1) == (DuelClient::selftype & 0x1);
} else {
is_self = (player == 0);
is_self = player == 0;
}
return player | (is_self ? 0x10 : 0);
} else {
// when in lobby
return player | (player == DuelClient::selftype ? 0x10 : 0);
is_self = player == DuelClient::selftype;
}
if(dInfo.isTag && (player == 1 || player == 2)) {
player = 3 - player;
}
return player | (is_self ? 0x10 : 0);
}
const wchar_t* Game::LocalName(int local_player) {
return local_player == 0 ? dInfo.hostname : dInfo.clientname;
......
......@@ -169,8 +169,8 @@ public:
void CloseDuelWindow();
int LocalPlayer(int player) const;
int OppositePlayer(int player) const;
int ChatLocalPlayer(int player) const;
int OppositePlayer(int player);
int ChatLocalPlayer(int player);
const wchar_t* LocalName(int local_player);
bool HasFocus(EGUI_ELEMENT_TYPE type) const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment