mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
a nicer solution for changeset:1669
This commit is contained in:
parent
d3d2fb2c0b
commit
cd1c92c41b
|
@ -115,11 +115,10 @@ void GAMECONTROLLER_CTF::tick()
|
|||
int num = game.world.find_entities(f->pos, 32.0f, (ENTITY**)close_characters, MAX_CLIENTS, NETOBJTYPE_CHARACTER);
|
||||
for(int i = 0; i < num; i++)
|
||||
{
|
||||
if(!close_characters[i]->alive || close_characters[i]->player->team == -1)
|
||||
if(!close_characters[i]->alive || close_characters[i]->player->team == -1 || col_intersect_line(f->pos, close_characters[i]->pos, NULL))
|
||||
continue;
|
||||
|
||||
int collision = col_intersect_line(f->pos, close_characters[i]->pos, NULL);
|
||||
if(!collision && close_characters[i]->team == f->team)
|
||||
if(close_characters[i]->team == f->team)
|
||||
{
|
||||
// return the flag
|
||||
if(!f->at_stand)
|
||||
|
@ -135,7 +134,7 @@ void GAMECONTROLLER_CTF::tick()
|
|||
f->reset();
|
||||
}
|
||||
}
|
||||
else if(!collision)
|
||||
else
|
||||
{
|
||||
// take the flag
|
||||
if(f->at_stand)
|
||||
|
|
Loading…
Reference in a new issue