summaryrefslogtreecommitdiff
path: root/modules/modPipe.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-19 19:28:04 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-19 19:28:04 +0000
commita370d2f5860a0f89ac44af857d1059885ad1d60f (patch)
tree5ad5112a884e41367b271a8ea3509dec04524819 /modules/modPipe.c
parentfadf9365dba24b680db5cb8750c53e264ff1ec27 (diff)
- upravy v kode
- prepis stirel pre space_t * - v kode su dva vyhladavacie algortmy, implicitne sa pouziva ten ktory funguje :) ten co nefunguje je zamakrovany makrom SUPPORT_ERROR a este ho musim doladit git-svn-id: http://opensvn.csie.org/tuxanci_ng@66 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'modules/modPipe.c')
-rwxr-xr-xmodules/modPipe.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/modules/modPipe.c b/modules/modPipe.c
index e5f628d..2c1a6e5 100755
--- a/modules/modPipe.c
+++ b/modules/modPipe.c
@@ -218,6 +218,7 @@ static void moveShot(shot_t *shot, int position, int src_x, int src_y,
int dist_x, int dist_y, int dist_w, int dist_h)
{
int offset = 0;
+ int new_x, new_y;
switch( shot->position )
{
@@ -237,34 +238,35 @@ static void moveShot(shot_t *shot, int position, int src_x, int src_y,
switch( shot->position )
{
case TUX_UP :
- shot->x = dist_x + offset;
- shot->y = dist_y;
+ new_x = dist_x + offset;
+ new_y = dist_y;
break;
case TUX_LEFT :
- shot->x = dist_x;
- shot->y = dist_y + offset;
+ new_x = dist_x;
+ new_y = dist_y + offset;
break;
case TUX_RIGHT :
- shot->x = dist_x + dist_w;
- shot->y = dist_y + offset;
+ new_x = dist_x + dist_w;
+ new_y = dist_y + offset;
break;
case TUX_DOWN :
- shot->x = dist_x + offset;
- shot->y = dist_y + dist_h;
+ new_x = dist_x + offset;
+ new_y = dist_y + dist_h;
break;
}
- shot->x += shot->px;
- shot->y += shot->py;
+ new_y += shot->px;
+ new_y += shot->py;
+
+ moveObjectInSpace(export_fce->fce_getCurrentArena()->spaceShot, shot, new_x, new_y);
if( export_fce->fce_getNetTypeGame() == NET_GAME_TYPE_SERVER )
{
export_fce->fce_proto_send_shot_server(PROTO_SEND_ALL, NULL, shot);
}
-
}
static void moveShotFromPipe(shot_t *shot, pipe_t *pipe)
@@ -360,12 +362,12 @@ int event()
*/
arena = export_fce->fce_getCurrentArena();
- for( i = 0 ; i < arena->listShot->count ; i++ )
+ for( i = 0 ; i < arena->spaceShot->list->count ; i++ )
{
shot_t *thisShot;
int j;
- thisShot = (shot_t *)arena->listShot->list[i];
+ thisShot = (shot_t *) arena->spaceShot->list->list[i];
assert( thisShot != NULL );
listDoEmpty(listPipe);
@@ -394,7 +396,9 @@ int event()
{
if( thisShot->gun != GUN_BOMBBALL )
{
- delListItem(arena->listShot, i, export_fce->fce_destroyShot);
+ delObjectFromSpaceWithObject(export_fce->fce_getCurrentArena()->spaceShot,
+ thisShot, export_fce->fce_destroyShot);
+ //delListItem(arena->listShot, i, export_fce->fce_destroyShot);
i--;
}
}
@@ -414,7 +418,8 @@ int event()
}
else
{
- delListItem(arena->listShot, i, export_fce->fce_destroyShot);
+ delObjectFromSpaceWithObject(export_fce->fce_getCurrentArena()->spaceShot,
+ thisShot, export_fce->fce_destroyShot);
i--;
}
}