mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed so that the local player is always rendered above the other players
This commit is contained in:
parent
accc4799ed
commit
b717297b63
|
@ -458,6 +458,9 @@ void PLAYERS::render_player(
|
|||
}
|
||||
|
||||
void PLAYERS::on_render()
|
||||
{
|
||||
// render other players in two passes, first pass we render the other, second pass we render our self
|
||||
for(int p = 0; p < 2; p++)
|
||||
{
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
|
@ -470,6 +473,11 @@ void PLAYERS::on_render()
|
|||
|
||||
if(prev_info && info)
|
||||
{
|
||||
//
|
||||
bool local = ((const NETOBJ_PLAYER_INFO *)info)->local !=0;
|
||||
if(p == 0 && local) continue;
|
||||
if(p == 1 && !local) continue;
|
||||
|
||||
NETOBJ_CHARACTER prev_char = gameclient.snap.characters[i].prev;
|
||||
NETOBJ_CHARACTER cur_char = gameclient.snap.characters[i].cur;
|
||||
|
||||
|
@ -482,3 +490,4 @@ void PLAYERS::on_render()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue