mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 20:12:50 +02:00
Prevent integer overflow with emp_decor
This commit is contained in:
@@ -1733,7 +1733,7 @@ void draw_other(pixel *vid) // EMP effect
|
|||||||
if (emp_decor>40) emp_decor=40;
|
if (emp_decor>40) emp_decor=40;
|
||||||
if (cmode==CM_NOTHING) // no in nothing mode
|
if (cmode==CM_NOTHING) // no in nothing mode
|
||||||
return;
|
return;
|
||||||
if (emp_decor)
|
if (emp_decor>0)
|
||||||
{
|
{
|
||||||
int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
|
int r=emp_decor*2.5, g=100+emp_decor*1.5, b=255;
|
||||||
int a=(1.0*emp_decor/110)*255;
|
int a=(1.0*emp_decor/110)*255;
|
||||||
|
Reference in New Issue
Block a user