|
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Reflection; |
4 | 4 | using Anvil.Internal; |
| 5 | +using Anvil.Native; |
5 | 6 | using NWN.Core; |
6 | 7 | using NWN.Native.API; |
7 | 8 |
|
@@ -126,18 +127,18 @@ public static IEnumerable<T> FindObjectsWithTag<T>(params string[] tags) where T |
126 | 127 | { |
127 | 128 | return (ObjectType)gameObject.m_nObjectType switch |
128 | 129 | { |
129 | | - ObjectType.Creature => new NwCreature(gameObject.AsNWSCreature()), |
130 | | - ObjectType.Item => new NwItem(gameObject.AsNWSItem()), |
131 | | - ObjectType.Placeable => new NwPlaceable(gameObject.AsNWSPlaceable()), |
| 130 | + ObjectType.Creature => new NwCreature(CNWSCreature.FromPointer(NWNXUtils.AsNWSCreature(gameObject.Pointer))), |
| 131 | + ObjectType.Item => new NwItem(CNWSItem.FromPointer(NWNXUtils.AsNWSItem(gameObject.Pointer))), |
| 132 | + ObjectType.Placeable => new NwPlaceable(CNWSPlaceable.FromPointer(NWNXUtils.AsNWSPlaceable(gameObject.Pointer))), |
132 | 133 | ObjectType.Module => NwModule.Instance, |
133 | | - ObjectType.Area => new NwArea(gameObject.AsNWSArea()), |
134 | | - ObjectType.Trigger => new NwTrigger(gameObject.AsNWSTrigger()), |
135 | | - ObjectType.Door => new NwDoor(gameObject.AsNWSDoor()), |
136 | | - ObjectType.Waypoint => new NwWaypoint(gameObject.AsNWSWaypoint()), |
137 | | - ObjectType.Encounter => new NwEncounter(gameObject.AsNWSEncounter()), |
138 | | - ObjectType.Store => new NwStore(gameObject.AsNWSStore()), |
139 | | - ObjectType.Sound => new NwSound(gameObject.AsNWSSoundObject()), |
140 | | - ObjectType.AreaOfEffect => new NwAreaOfEffect(gameObject.AsNWSAreaOfEffectObject()), |
| 134 | + ObjectType.Area => new NwArea(CNWSArea.FromPointer(NWNXUtils.AsNWSArea(gameObject.Pointer))), |
| 135 | + ObjectType.Trigger => new NwTrigger(CNWSTrigger.FromPointer(NWNXUtils.AsNWSTrigger(gameObject.Pointer))), |
| 136 | + ObjectType.Door => new NwDoor(CNWSDoor.FromPointer(NWNXUtils.AsNWSDoor(gameObject.Pointer))), |
| 137 | + ObjectType.Waypoint => new NwWaypoint(CNWSWaypoint.FromPointer(NWNXUtils.AsNWSWaypoint(gameObject.Pointer))), |
| 138 | + ObjectType.Encounter => new NwEncounter(CNWSEncounter.FromPointer(NWNXUtils.AsNWSEncounter(gameObject.Pointer))), |
| 139 | + ObjectType.Store => new NwStore(CNWSStore.FromPointer(NWNXUtils.AsNWSStore(gameObject.Pointer))), |
| 140 | + ObjectType.Sound => new NwSound(CNWSSoundObject.FromPointer(NWNXUtils.AsNWSSoundObject(gameObject.Pointer))), |
| 141 | + ObjectType.AreaOfEffect => new NwAreaOfEffect(CNWSAreaOfEffectObject.FromPointer(NWNXUtils.AsNWSAreaOfEffectObject(gameObject.Pointer))), |
141 | 142 | _ => null, |
142 | 143 | }; |
143 | 144 | } |
|
0 commit comments