diff options
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/bomb.cpp | 4 | ||||
| -rw-r--r-- | src/elements/figh.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/elements/bomb.cpp b/src/elements/bomb.cpp index 3b6db26..99eb7f0 100644 --- a/src/elements/bomb.cpp +++ b/src/elements/bomb.cpp @@ -31,7 +31,7 @@ int update_BOMB(UPDATE_FUNC_ARGS) { pmap[y][x] = 0; for (nxj=-(rad+1); nxj<=(rad+1); nxj++) for (nxi=-(rad+1); nxi<=(rad+1); nxi++) - if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1) { + if ((pow((float)nxi,2))/(pow((float)(rad+1),2))+(pow((float)nxj,2))/(pow((float)(rad+1),2))<=1) { nb = sim->create_part(-1, x+nxi, y+nxj, PT_BOMB); if (nb!=-1) { parts[nb].tmp = 1; @@ -43,7 +43,7 @@ int update_BOMB(UPDATE_FUNC_ARGS) { } for (nxj=-rad; nxj<=rad; nxj++) for (nxi=-rad; nxi<=rad; nxi++) - if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1) + if ((pow((float)nxi,2))/(pow((float)rad,2))+(pow((float)nxj,2))/(pow((float)rad,2))<=1) if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) { sim->delete_part(x+nxi, y+nxj, 0);//it SHOULD kill anything but the exceptions above, doesn't seem to always work sim->pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f; diff --git a/src/elements/figh.cpp b/src/elements/figh.cpp index 6a8bb4e..6b67a27 100644 --- a/src/elements/figh.cpp +++ b/src/elements/figh.cpp @@ -11,8 +11,8 @@ int update_FIGH(UPDATE_FUNC_ARGS) //Set target cords if (sim->player.spwn && sim->player2.spwn) { - if ((pow(sim->player.legs[2]-x, 2) + pow(sim->player.legs[3]-y, 2))<= - (pow(sim->player2.legs[2]-x, 2) + pow(sim->player2.legs[3]-y, 2))) + if ((pow((float)sim->player.legs[2]-x, 2) + pow((float)sim->player.legs[3]-y, 2))<= + (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2))) { tarx = (unsigned int)sim->player.legs[2]; tary = (unsigned int)sim->player.legs[3]; @@ -43,7 +43,7 @@ int update_FIGH(UPDATE_FUNC_ARGS) switch (parts[i].tmp2) { case 1: - if ((pow(tarx-x, 2) + pow(tary-y, 2))<600) + if ((pow(float(tarx-x), 2) + pow(float(tary-y), 2))<600) { if (figh->elem == PT_LIGH || figh->elem == PT_NEUT || sim->ptypes[figh->elem].properties&(PROP_DEADLY|PROP_RADIOACTIVE) |
