Page MenuHomeFeedback Tracker

foreach not pinning references?
Assigned, UrgentPublic

Description

This crashes as GetEntityDamageZoneMap() saying the result is NULL (when it is not).

		foreach (string zone, array<string> zoneNames: m_Vehicle.GetEntityDamageZoneMap()) {
			foreach (string zoneName: zoneNames) {
				Print(zoneName);
			}
		}

This works as it appears to have soft pinned the return?

		auto allZones = m_Vehicle.GetEntityDamageZoneMap();
		foreach (string zone, array<string> zoneNames: allZones) {
			foreach (string zoneName: zoneNames) {
				Print(zoneName);
			}
		}

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce

Attempt the following on a carscript

		foreach (string zone, array<string> zoneNames: m_Vehicle.GetEntityDamageZoneMap()) {
			foreach (string zoneName: zoneNames) {
				Print(zoneName);
			}
		}

Event Timeline

antihax created this task.Sep 23 2023, 5:42 AM

This may be related or duplicate of https://feedback.bistudio.com/T173049

Geez changed the task status from New to Assigned.Sep 25 2023, 4:13 PM