mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fix for ticket #549 by using col_intersect_line
This commit is contained in:
parent
12127c0acd
commit
e1807ea08a
|
@ -115,7 +115,8 @@ 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]->team == f->team)
|
||||
int collision = col_intersect_line(f->pos, close_characters[i]->pos, NULL);
|
||||
if(!collision && close_characters[i]->team == f->team)
|
||||
{
|
||||
// return the flag
|
||||
if(!f->at_stand)
|
||||
|
@ -131,7 +132,7 @@ void GAMECONTROLLER_CTF::tick()
|
|||
f->reset();
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(!collision)
|
||||
{
|
||||
// take the flag
|
||||
if(f->at_stand)
|
||||
|
|
Loading…
Reference in a new issue