summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorDusan Durech <dusan.d@Centrum.sk>2009-04-26 16:52:31 +0200
committerDusan Durech <dusan.d@Centrum.sk>2009-04-26 16:52:31 +0200
commitb0c3502e6ce02371be6b401538b5b6718a71f414 (patch)
tree9a5f30bfcec1ff63d7334476defc3ca0c4e354da /src/base
parent71571a8407a4944720646ab4e80e83eb0b7a6093 (diff)
fix assert bug in space.c ( very old bug )
Diffstat (limited to 'src/base')
-rw-r--r--src/base/item.c4
-rw-r--r--src/base/tux.c22
2 files changed, 14 insertions, 12 deletions
diff --git a/src/base/item.c b/src/base/item.c
index f7539ad..02533b3 100644
--- a/src/base/item.c
+++ b/src/base/item.c
@@ -351,10 +351,6 @@ static void mineExplosion(space_t * spaceItem, item_t * item)
static void action_item(space_t * space, item_t * item, int *isDel)
{
- arena_t *arena;
-
- arena = arena_get_current();
-
switch (item->type) {
case ITEM_MINE:
if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT)
diff --git a/src/base/tux.c b/src/base/tux.c
index baf185a..287ffea 100644
--- a/src/base/tux.c
+++ b/src/base/tux.c
@@ -398,20 +398,17 @@ static void bombBallExplosion(shot_t * shot)
space_add(arena_get_current()->spaceItem, item);
if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
- proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
+ //proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
proto_send_additem_server(PROTO_SEND_ALL, NULL, item);
}
- space_del_with_item(arena_get_current()->spaceShot, shot, shot_destroy);
+ //space_del_with_item(arena_get_current()->spaceShot, shot, shot_destroy);
+
}
static void action_tux(space_t * space, tux_t * tux, shot_t * shot)
{
- arena_t *arena;
-
UNUSED(space);
-
- arena = arena_get_current();
if (tux->status == TUX_STATUS_ALIVE) {
if (shot->author_id == tux->id && shot->isCanKillAuthor == FALSE) {
@@ -426,6 +423,7 @@ static void action_tux(space_t * space, tux_t * tux, shot_t * shot)
if (shot->gun == GUN_BOMBBALL) {
if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) {
bombBallExplosion(shot);
+ shot->del = TRUE;
}
return;
@@ -436,18 +434,26 @@ static void action_tux(space_t * space, tux_t * tux, shot_t * shot)
}
}
+ shot->del = TRUE;
+/*
if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) {
proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
}
space_del_with_item(arena->spaceShot, shot, shot_destroy);
+*/
}
static void action_shot(space_t * space, shot_t * shot, space_t * spaceTux)
{
- UNUSED(space);
-
space_action_from_location(spaceTux, action_tux, shot, shot->x, shot->y, shot->w, shot->h);
+
+ if (shot->del == TRUE) {
+ if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER)
+ proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id);
+
+ space_del_with_item(space, shot, shot_destroy);
+ }
}
void tux_conflict_woth_shot(arena_t * arena)