Skip to content

Search and Destroy Battleplan permanently sets incorrect shroud clearing radius for buildings while the plan is active #2342

@alanblack166

Description

@alanblack166

Prerequisites

  • I have searched for similar issues and confirmed this is not a duplicate

Game Version

  • Command & Conquer Generals
  • Command & Conquer Generals: Zero Hour
  • Other (please specify below)

Bug Description

The BattlePlanUpdate::setBattlePlan method, if the battle plan is set to PLANSTATUS_SEARCHANDDESTROY, can add a sight range bonus to eligible objects.

This is done in line 827 of BattlePlanUpdate.cpp:
obj->setShroudClearingRange( obj->getShroudClearingRange() * data->m_strategyCenterSearchAndDestroySightRangeScalar );

The Object::getShroudClearingRange() method has a condition where if the object is under construction, instead of using the ShroudClearingRange parameter defined in the Object's INI code, it will instead take the building's geometry and add the bonus to it, then set that as the new shroud clearing radius. The original intent of this, most likely, was to prevent scaffold abuse for scouting with their normal shroud clearing range:

	if( getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
	{
		//structures under construction have limited vision range.  For now, base it
		//on the geometry extents so the structure can only see itself.
		shroudClearingRange = getGeometryInfo().getBoundingCircleRadius();
	}

However, if Search & Destroy is modified to affect USA defences, for example, any defence built while the plan is active will have permanently crippled shroud clearing range. Changing the plans does not fix the issue:

Image

Reproduction Steps

  1. Modify the Strategy Center's BattlePlanUpdate module to remove STRUCTURES from InvalidMemberKindOf list.
  2. Build Strategy Center and activate Search & Destroy
  3. Build defence or building with shroud clearing range.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facingMinorSeverity: Minor < Major < Critical < BlockerModRelates to Mods or modding

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions