summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-06-22 15:24:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-25 14:52:11 (GMT)
commit04b3eb11fd32daaf094df676d2037ed613c172a0 (patch)
tree6027e8fbf913ba1a3c213dcaaf01c5c76995f631 /src
parent9b83bf27a8933f6dd33110cfb733935309e23afa (diff)
downloadpowder-04b3eb11fd32daaf094df676d2037ed613c172a0.zip
powder-04b3eb11fd32daaf094df676d2037ed613c172a0.tar.gz
Fixes for high life stickman
Diffstat (limited to 'src')
-rw-r--r--src/elements/stkm.c3
-rw-r--r--src/elements/stkm2.c3
-rw-r--r--src/graphics.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index 01990f6..55fc225 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -211,7 +211,8 @@ int update_STKM(UPDATE_FUNC_ARGS) {
if ((r&0xFF) == PT_NEUT)
{
- parts[i].life -= (102-parts[i].life)/2;
+ if (parts[i].life<=100) parts[i].life -= (102-parts[i].life)/2;
+ else parts[i].life *= 0.9f;
kill_part(r>>8);
}
if (bmap[(ry+y)/CELL][(rx+x)/CELL]==WL_FAN)
diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c
index a2731a6..02ed09f 100644
--- a/src/elements/stkm2.c
+++ b/src/elements/stkm2.c
@@ -211,7 +211,8 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
if ((r&0xFF) == PT_NEUT)
{
- parts[i].life -= (102-parts[i].life)/2;
+ if (parts[i].life<=100) parts[i].life -= (102-parts[i].life)/2;
+ else parts[i].life *= 0.9f;
kill_part(r>>8);
}
if (bmap[(ry+y)/CELL][(rx+x)/CELL]==WL_FAN)
diff --git a/src/graphics.c b/src/graphics.c
index 036a743..fd6213f 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1698,7 +1698,7 @@ void draw_parts(pixel *vid)
{
if (t==PT_STKM) //Just draw head here
{
- char buff[10]; //Buffer for HP
+ char buff[20]; //Buffer for HP
pixel pc;
if (mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head
@@ -1726,7 +1726,7 @@ void draw_parts(pixel *vid)
}
else if (t==PT_STKM2) //Just draw head here
{
- char buff[10]; //Buffer for HP
+ char buff[20]; //Buffer for HP
pixel pc;
if (mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head