Fixed divide by 0

This commit is contained in:
jsalmon3 2003-03-06 00:49:13 +00:00
parent 1457adbb45
commit e35f98822d
2 changed files with 9 additions and 2 deletions

View file

@ -10,7 +10,7 @@
//
/**@name mainscr.c - The main screen. */
//
// (c) Copyright 1998,2000-2002 by Lutz Sammer and Valery Shchedrin
// (c) Copyright 1998,2000-2003 by Lutz Sammer and Valery Shchedrin
//
// FreeCraft is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
@ -133,6 +133,9 @@ local void UiDrawCompleted(int full,int ready)
{
int f;
if( !full ) {
return;
}
f=(100*ready)/full;
f=(f*152)/100;
VideoFillRectangleClip(TheUI.CompleteBarColor

View file

@ -787,8 +787,12 @@ local void DrawManaSprite(int x,int y,const UnitType* type,int full,int ready)
*/
local void DrawManaBar(int x,int y,const UnitType* type,int full,int ready)
{
int f, w;
int f;
int w;
if( !full ) {
return;
}
f=(100*ready)/full;
if ( ShowManaHorizontal == 0) {
VideoFillRectangleClip(ColorBlue