Prevent integer overflow with emp_decor

This commit is contained in:
Simon Robertshaw 2011-10-14 12:12:27 +01:00
parent 56764a2309
commit 1af0a86e0d

View File

@ -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;