VMFInstanceInserter icon indicating copy to clipboard operation
VMFInstanceInserter copied to clipboard

Unhandled exception for numerical entity names

Open RevCosmosis opened this issue 8 years ago • 3 comments

Hammer will occasionally decide to notate rotation angles with e, with rotations such as "-0 1.00179e-005 0." This causes vmfii to throw an error, since it thinks this is a string and not an integer.

Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'VMFInstanceInserter.VMFNumberValue' to type 'VMFInstanceInserter.VMFStringValue'. at VMFInstanceInserter.VMFStructure..ctor(VMFStructure clone, Int32 idOffset, Int32 nodeOffset, TargetNameFixupStyle fixupStyle, String targetName, List1 replacements, List1 matReplacements) at VMFInstanceInserter.VMFFile.ResolveInstances() at VMFInstanceInserter.Program.Main(String[] args)

RevCosmosis avatar May 24 '16 19:05 RevCosmosis

Turns out I was totally wrong! I think the issue actually occurs when you name an entity inside of an instance to something that is just an integer, like "1".

RevCosmosis avatar May 24 '16 19:05 RevCosmosis

Ah that would make sense, I'll try to fix this tonight. Thanks for reporting!

Metapyziks avatar May 25 '16 12:05 Metapyziks

Just remembered about this, having a go at fixing now.

Metapyziks avatar May 26 '16 21:05 Metapyziks