From a4a10cf6ec99393d3cc7b941bcb51e8a17e8af55 Mon Sep 17 00:00:00 2001 From: Cyp Date: Wed, 4 Jan 2012 20:03:02 +0100 Subject: [PATCH] Fix broken CALL_*_SEEN. clustObjectSeen() now checks using hasSharedVision(), since clustObjectSeen() is called before DROID::visible is set. Also, remove the backup of this bug, in scrCBObjectSeen(). Fixes ticket:1855. --- src/cluster.cpp | 4 +--- src/scriptcb.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index bf2cf1b7d..e199b6227 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -520,11 +520,9 @@ void clustObjectSeen(BASE_OBJECT *psObj, BASE_OBJECT *psViewer) { ASSERT(psObj->cluster != (UBYTE)~0, "object not in a cluster"); if ( (player != (SDWORD)psObj->player) && - psObj->visible[player] && + hasSharedVision(psViewer->player, player) && !(aClusterVisibility[psObj->cluster] & (1 << player))) { -// DBPRINTF(("cluster %d (player %d) seen by player %d\n", -// clustGetClusterID(psObj), psObj->player, player)); aClusterVisibility[psObj->cluster] |= 1 << player; psScrCBObjSeen = psObj; diff --git a/src/scriptcb.cpp b/src/scriptcb.cpp index f848af090..ddd21f87e 100644 --- a/src/scriptcb.cpp +++ b/src/scriptcb.cpp @@ -523,9 +523,7 @@ static bool scrCBObjectSeen(SDWORD callback) } *ppsObj = NULL; - if (((psScrCBObjViewer != NULL) && - (psScrCBObjViewer->player != player)) || - !psScrCBObjSeen->visible[player]) + if (psScrCBObjViewer != NULL && psScrCBObjViewer->player != player) { retval = false; }