Skip to content

Commit c7475ad

Browse files
committed
Fixed player drawing on the mini-map in demo mode
1 parent 8c1632c commit c7475ad

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

defender/WCBackground.m

+19-8
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ - (void)drawMinMap
407407
{
408408
switch([anAi isA])
409409
{
410+
case DB_PLAYER: // Only in Demo mode - fake player
411+
[[NSColor whiteColor] set];
412+
break;
413+
410414
case DB_LANDER:
411415
case DB_BAITER:
412416
[[NSColor greenColor] set];
@@ -452,14 +456,21 @@ - (void)drawMinMap
452456
[NSBezierPath fillRect:aRect];
453457
}
454458

455-
// draw the player
456-
aRect.origin = WCGlobals.globalsManager.thePlayer.worldPosition;
457-
aRect.origin.x -= drawPoint.x;
458-
if(aRect.origin.x < 0.0)
459-
aRect.origin.x += fieldSize.width;
460-
[[NSColor whiteColor] set];
461-
[NSBezierPath fillRect:aRect];
462-
459+
// draw the player - not in demo mode, then use fake player
460+
if(WCGlobals.globalsManager.renderVitals)
461+
{
462+
aRect.origin = WCGlobals.globalsManager.thePlayer.worldPosition;
463+
aRect.origin.x -= drawPoint.x;
464+
if(aRect.origin.x < 0.0)
465+
aRect.origin.x += fieldSize.width;
466+
[[NSColor whiteColor] set];
467+
[NSBezierPath fillRect:aRect];
468+
}
469+
else
470+
{
471+
[[NSColor whiteColor] set];
472+
}
473+
463474
// Draw the screen size indicators
464475
[aPath setLineWidth:BG_MAP_ICON_SIZE];
465476
drawPoint = NSMakePoint(hfw - hvw, 40.0);

0 commit comments

Comments
 (0)