Skip to content

Commit

Permalink
Fix broken CALL_*_SEEN.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Cyp committed Jan 4, 2012
1 parent 9e6b7c3 commit a4a10cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/cluster.cpp
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions src/scriptcb.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit a4a10cf

Please sign in to comment.