Render objects in front of landscape only once

The plane limits in C4ObjectList::Draw were not properly checked,
leading to objects in front of the landscape being drawn twice (once
before the landscape was rendered, and once after).
liquid_container
Nicolas Hake 2016-02-25 01:09:48 +01:00
parent bfd9989fc6
commit 48ccc5f983
1 changed files with 2 additions and 2 deletions

View File

@ -384,7 +384,7 @@ void C4ObjectList::Draw(C4TargetFacet &cgo, int iPlayer, int MinPlane, int MaxPl
// Draw objects (base)
for (clnk=first; clnk; clnk=clnk->Prev)
{
if (first->Obj->GetPlane() > MaxPlane)
if (clnk->Obj->GetPlane() > MaxPlane)
break;
if (clnk->Obj->Category & C4D_Foreground)
continue;
@ -393,7 +393,7 @@ void C4ObjectList::Draw(C4TargetFacet &cgo, int iPlayer, int MinPlane, int MaxPl
// Draw objects (top face)
for (clnk=first; clnk; clnk=clnk->Prev)
{
if (first->Obj->GetPlane() > MaxPlane)
if (clnk->Obj->GetPlane() > MaxPlane)
break;
if (clnk->Obj->Category & C4D_Foreground)
continue;