AttacqueSuperior / Engine

A customized fork for the modification Attacque Supérior of the open-source implementation of the Command & Conquer: Red Alert engine using .NET/Mono and OpenGL. Runs on Windows, Linux and Mac OS X.
http://attsup.swr-productions.com
GNU General Public License v3.0
16 stars 3 forks source link

SpawnActorWarhead don't work with Immobile: actors. #84

Closed MustaphaTR closed 5 years ago

MustaphaTR commented 5 years ago

I was looking why i have been using Mobile with Speed: 1 with mines on RV while RA1 mines use Immobile, seems like SpawnActorWarhead crash with following in that case. Using Immobile is nice for mines to ensure they don't move anywhere (Building also works but they can't be placed on resources).

OpenRA engine version 810d59c
Red Alert 2: Romanov's Vengeance mod version 810d59c
on map adad2f3f86955ec2cd9008cb52c12ac8b9632732 (Official Tournament Map B by Westwood Studios).
Date: 2019-01-03 13:03:03Z
Operating System: Windows (Microsoft Windows NT 6.2.9200.0)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `System.InvalidOperationException`: TypeDictionary does not contain instance of type `OpenRA.LocationInit`
   konum: OpenRA.Primitives.TypeDictionary.Get(Type t, Boolean throwsIfMissing) c:\OpenRA\RV\engine\OpenRA.Game\Primitives\TypeDictionary.cs içinde: satır 63
   konum: OpenRA.Primitives.TypeDictionary.Get[T]() c:\OpenRA\RV\engine\OpenRA.Game\Primitives\TypeDictionary.cs içinde: satır 46
   konum: OpenRA.ActorInitializer.Get[T,U]() c:\OpenRA\RV\engine\OpenRA.Game\Map\ActorInitializer.cs içinde: satır 39
   konum: OpenRA.Mods.Common.Traits.Immobile..ctor(ActorInitializer init, ImmobileInfo info) c:\OpenRA\RV\engine\OpenRA.Mods.Common\Traits\Immobile.cs içinde: satır 42
   konum: OpenRA.Mods.Common.Traits.ImmobileInfo.Create(ActorInitializer init) c:\OpenRA\RV\engine\OpenRA.Mods.Common\Traits\Immobile.cs içinde: satır 21
   konum: OpenRA.Actor..ctor(World world, String name, TypeDictionary initDict) c:\OpenRA\RV\engine\OpenRA.Game\Actor.cs içinde: satır 106
   konum: OpenRA.World.CreateActor(Boolean addToWorld, String name, TypeDictionary initDict) c:\OpenRA\RV\engine\OpenRA.Game\World.cs içinde: satır 268
   konum: OpenRA.Mods.AS.Warheads.SpawnActorWarhead.DoImpact(Target target, Actor firedBy, IEnumerable`1 damageModifiers)
   konum: OpenRA.GameRules.WeaponInfo.Impact(Target target, Actor firedBy, IEnumerable`1 damageModifiers) c:\OpenRA\RV\engine\OpenRA.Game\GameRules\WeaponInfo.cs içinde: satır 189
   konum: OpenRA.Mods.AS.Traits.DetonateWeaponPower.<>c__DisplayClass9.<Activate>b__1(World w)
   konum: OpenRA.World.Tick() c:\OpenRA\RV\engine\OpenRA.Game\World.cs içinde: satır 370
   konum: OpenRA.Game.InnerLogicTick(OrderManager orderManager) c:\OpenRA\RV\engine\OpenRA.Game\Game.cs içinde: satır 616
   konum: OpenRA.Game.LogicTick() c:\OpenRA\RV\engine\OpenRA.Game\Game.cs içinde: satır 640
   konum: OpenRA.Game.Loop() c:\OpenRA\RV\engine\OpenRA.Game\Game.cs içinde: satır 770
   konum: OpenRA.Game.Run() c:\OpenRA\RV\engine\OpenRA.Game\Game.cs içinde: satır 810
   konum: OpenRA.Game.InitializeAndRun(String[] args) c:\OpenRA\RV\engine\OpenRA.Game\Game.cs içinde: satır 256
   konum: OpenRA.Program.Main(String[] args) c:\OpenRA\RV\engine\OpenRA.Game\Support\Program.cs içinde: satır 37
GraionDilach commented 5 years ago

Have you tried SpawnBuildingWarhead?

MustaphaTR commented 5 years ago

It checks for Building trait, crashes with SpawnBuildingWarhead don't work with non-building actors. I dunno if removing the check/making it check for Immobile too would work as is.