Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ void W3DPowerDraw( GameWindow *window, WinInstanceData *instData )
if( !slider || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageWidth() <= 0 )
return;

Int range;
range = logN(production, TheGlobalData->m_powerBarBase) * (size.x / TheGlobalData->m_powerBarIntervals);
if(range >= size.x)
Expand Down Expand Up @@ -338,6 +342,10 @@ void W3DPowerDrawA( GameWindow *window, WinInstanceData *instData )
if( !slider || !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageWidth() <= 0 )
return;

Int range;
range = logN(production, TheGlobalData->m_powerBarBase) * (size.x / TheGlobalData->m_powerBarIntervals);
if(range >= size.x)
Expand Down Expand Up @@ -516,6 +524,10 @@ void W3DCommandBarGenExpDraw( GameWindow *window, WinInstanceData *instData )
if( !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageHeight() <= 0 )
return;

Int range;
range = size.y * progress / 100;

Expand Down Expand Up @@ -928,6 +940,9 @@ void W3DCommandBarHelpPopupDraw( GameWindow *window, WinInstanceData *instData )
if( !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageHeight() <= 0 )
return;

// Int range;
// range = size.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ void W3DPowerDraw( GameWindow *window, WinInstanceData *instData )
if( !slider || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageWidth() <= 0 )
return;

Int range;
range = logN(production, TheGlobalData->m_powerBarBase) * (size.x / TheGlobalData->m_powerBarIntervals);
if(range >= size.x)
Expand Down Expand Up @@ -338,6 +342,10 @@ void W3DPowerDrawA( GameWindow *window, WinInstanceData *instData )
if( !slider || !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageWidth() <= 0 )
return;

Int range;
range = logN(production, TheGlobalData->m_powerBarBase) * (size.x / TheGlobalData->m_powerBarIntervals);
if(range >= size.x)
Expand Down Expand Up @@ -516,6 +524,10 @@ void W3DCommandBarGenExpDraw( GameWindow *window, WinInstanceData *instData )
if( !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageHeight() <= 0 )
return;

Int range;
range = size.y * progress / 100;

Expand Down Expand Up @@ -928,6 +940,9 @@ void W3DCommandBarHelpPopupDraw( GameWindow *window, WinInstanceData *instData )
if( !endBar || !beginBar || !centerBar)
return;

// Validate image dimensions to prevent division by zero
if( centerBar->getImageHeight() <= 0 )
return;

// Int range;
// range = size.y;
Expand Down
Loading