From 04b3eb11fd32daaf094df676d2037ed613c172a0 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 22 Jun 2011 16:24:23 +0100 Subject: [PATCH] Fixes for high life stickman --- src/elements/stkm.c | 3 ++- src/elements/stkm2.c | 3 ++- src/graphics.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 01990f628..55fc225ec 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 a2731a645..02ed09fdb 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 036a7439d..fd6213f9d 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