3 changes: 0 additions & 3 deletions src/scriptfuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
#include "levels.h"
#include "mission.h"
#include "projectile.h"
#include "cluster.h"
#include "multigifts.h" //because of giftRadar()
#include "display3d.h" //for showRangeAtPos()
#include "multimenu.h"
Expand Down Expand Up @@ -5948,8 +5947,6 @@ bool scrResetPlayerVisibility()
psObj->visible[player] = 0;
}

clustResetVisibility(player);

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/scriptobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "scriptobj.h"
#include "group.h"
#include "lib/gamelib/gtime.h"
#include "cluster.h"
#include "messagedef.h"
#include "message.h"
#include "researchdef.h"
Expand Down Expand Up @@ -178,7 +177,8 @@ bool scrBaseObjGet(UDWORD index)
return false;
}
type = VAL_INT;
scrFunctionResult.v.ival = clustGetClusterID(psObj);
scrFunctionResult.v.ival = 0;
ASSERT(false, "unsupported wzscript feature");
break;
case OBJID_HEALTH:
switch (psObj->type)
Expand Down
20 changes: 3 additions & 17 deletions src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
#include "feature.h"
#include "mapgrid.h"
#include "projectile.h"
#include "cluster.h"
#include "intdisplay.h"
#include "display.h"
#include "difficulty.h"
Expand Down Expand Up @@ -1546,7 +1545,6 @@ STRUCTURE *buildStructureDir(STRUCTURE_STATS *pStructureType, UDWORD x, UDWORD y
//add the structure to the list - this enables it to be drawn whilst being built
addStructure(psBuilding);

clustNewStruct(psBuilding);
asStructureStats[max].curCount[player]++;

if (isLasSat(psBuilding->pStructureType))
Expand Down Expand Up @@ -4514,9 +4512,6 @@ bool removeStruct(STRUCTURE *psDel, bool bDestroy)
}
}

// remove the structure from the cluster
clustRemoveObject(psDel);

if (bDestroy)
{
debug(LOG_DEATH, "Killing off %s id %d (%p)", objInfo(psDel), psDel->id, psDel);
Expand Down Expand Up @@ -5590,8 +5585,6 @@ bool electronicDamage(BASE_OBJECT *psTarget, UDWORD damage, UBYTE attackPlayer)

psStructure->lastHitWeapon = WSC_ELECTRONIC;

// tell the cluster system it has been attacked
clustObjectAttacked(psStructure);
triggerEventAttacked(psStructure, g_pProjLastAttacker, lastHit);

psStructure->resistance = (SWORD)(psStructure->resistance - damage);
Expand Down Expand Up @@ -5637,8 +5630,6 @@ bool electronicDamage(BASE_OBJECT *psTarget, UDWORD damage, UBYTE attackPlayer)
}
else
{
// tell the cluster system it has been attacked
clustObjectAttacked(psDroid);
triggerEventAttacked(psDroid, g_pProjLastAttacker, lastHit);

psDroid->resistance = (SWORD)(psDroid->resistance - damage);
Expand Down Expand Up @@ -6627,8 +6618,6 @@ bool clearRearmPad(const STRUCTURE *psStruct)


// return the nearest rearm pad
// if bClear is true it tries to find the nearest clear rearm pad in
// the same cluster as psTarget
// psTarget can be NULL
STRUCTURE *findNearestReArmPad(DROID *psDroid, STRUCTURE *psTarget, bool bClear)
{
Expand Down Expand Up @@ -6658,9 +6647,9 @@ STRUCTURE *findNearestReArmPad(DROID *psDroid, STRUCTURE *psTarget, bool bClear)
psTotallyClear = nullptr;
for (STRUCTURE *psStruct = apsStructLists[psDroid->player]; psStruct; psStruct = psStruct->psNext)
{
if ((psStruct->pStructureType->type == REF_REARM_PAD) &&
(psTarget == nullptr || psTarget->cluster == psStruct->cluster) &&
(!bClear || clearRearmPad(psStruct)))
if (psStruct->pStructureType->type == REF_REARM_PAD
&& psTarget == nullptr
&& (!bClear || clearRearmPad(psStruct)))
{
xdiff = (SDWORD)psStruct->pos.x - cx;
ydiff = (SDWORD)psStruct->pos.y - cy;
Expand Down Expand Up @@ -6815,9 +6804,6 @@ STRUCTURE *giftSingleStructure(STRUCTURE *psStructure, UBYTE attackPlayer, bool
}
}

//add back into cluster system
clustNewStruct(psStructure);

if (psStructure->status == SS_BUILT)
{
buildingComplete(psStructure);
Expand Down
4 changes: 1 addition & 3 deletions src/structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,8 @@ true if it has*/
bool structVTOLCBSensor(const STRUCTURE *psStruct);

// return the nearest rearm pad
// if bClear is true it tries to find the nearest clear rearm pad in
// the same cluster as psTarget
// psTarget can be NULL
STRUCTURE *findNearestReArmPad(DROID *psDroid, STRUCTURE *psTarget, bool bClear);
STRUCTURE *findNearestReArmPad(DROID *psDroid, STRUCTURE *psTarget, bool bClear);

// check whether a rearm pad is clear
bool clearRearmPad(const STRUCTURE *psStruct);
Expand Down
1 change: 0 additions & 1 deletion src/transporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,6 @@ void transporterRemoveDroid(DROID *psTransport, DROID *psDroid, QUEUE_MODE mode)
initDroidMovement(psDroid);
//reset droid orders
orderDroid(psDroid, DORDER_STOP, ModeImmediate);
psDroid->cluster = 0;
// check if it is a commander
if (psDroid->droidType == DROID_COMMAND)
{
Expand Down
8 changes: 0 additions & 8 deletions src/visibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "geometry.h"
#include "hci.h"
#include "mapgrid.h"
#include "cluster.h"
#include "research.h"
#include "scriptextern.h"
#include "structure.h"
Expand Down Expand Up @@ -665,13 +664,6 @@ static void processVisibilityVision(BASE_OBJECT *psViewer)

// Check if scripting system wants to trigger an event for this
triggerEventSeen(psViewer, psObj);

// This looks like some kind of weird hack. Only used by wzscript.
if (psObj->type != OBJ_FEATURE && psObj->visible[psViewer->player] <= 0)
{
// features are not in the cluster system
clustObjectSeen(psObj, psViewer);
}
}
}
}
Expand Down