{"action":"closed","issue":{"url":"https://api.github.com/repos/Andrettin/Wyrmgus/issues/42","labels_url":"https://api.github.com/repos/Andrettin/Wyrmgus/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/Andrettin/Wyrmgus/issues/42/comments","events_url":"https://api.github.com/repos/Andrettin/Wyrmgus/issues/42/events","html_url":"https://github.com/Andrettin/Wyrmgus/issues/42","id":116194776,"number":42,"title":"Unit types don't properly inherit variations","user":{"login":"Andrettin","id":6322423,"avatar_url":"https://avatars.githubusercontent.com/u/6322423?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrettin","html_url":"https://github.com/Andrettin","followers_url":"https://api.github.com/users/Andrettin/followers","following_url":"https://api.github.com/users/Andrettin/following{/other_user}","gists_url":"https://api.github.com/users/Andrettin/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrettin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrettin/subscriptions","organizations_url":"https://api.github.com/users/Andrettin/orgs","repos_url":"https://api.github.com/users/Andrettin/repos","events_url":"https://api.github.com/users/Andrettin/events{/privacy}","received_events_url":"https://api.github.com/users/Andrettin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-10T20:28:31Z","updated_at":"2015-12-26T10:42:45Z","closed_at":"2015-12-26T10:42:45Z","body":"For some reason the variation code is not being inherited from \"parent\" unit types to their \"children\". This is the relevant code (in script_unittype.cpp):\r\n\r\n```\r\n\t\t\tfor (unsigned int var_n = 0; var_n < VariationMax; ++var_n) {\r\n\t\t\t\tif (parent_type->VarInfo[var_n]) {\r\n\t\t\t\t\tVariationInfo *var = new VariationInfo;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttype->VarInfo[var_n] = var;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar->VariationId = parent_type->VarInfo[var_n]->VariationId;\r\n\t\t\t\t\tvar->TypeName = parent_type->VarInfo[var_n]->TypeName;\r\n\t\t\t\t\tvar->File = parent_type->VarInfo[var_n]->File;\r\n\t\t\t\t\tfor (unsigned int i = 0; i < MaxCosts; ++i) {\r\n\t\t\t\t\t\tvar->FileWhenLoaded[i] = parent_type->VarInfo[var_n]->FileWhenLoaded[i];\r\n\t\t\t\t\t\tvar->FileWhenEmpty[i] = parent_type->VarInfo[var_n]->FileWhenEmpty[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar->ShadowFile = parent_type->VarInfo[var_n]->ShadowFile;\r\n\t\t\t\t\tvar->LeftArmFile = parent_type->VarInfo[var_n]->LeftArmFile;\r\n\t\t\t\t\tvar->RightArmFile = parent_type->VarInfo[var_n]->RightArmFile;\r\n\t\t\t\t\tvar->HairFile = parent_type->VarInfo[var_n]->HairFile;\r\n\t\t\t\t\tvar->ClothingFile = parent_type->VarInfo[var_n]->ClothingFile;\r\n\t\t\t\t\tvar->ClothingLeftArmFile = parent_type->VarInfo[var_n]->ClothingLeftArmFile;\r\n\t\t\t\t\tvar->ClothingRightArmFile = parent_type->VarInfo[var_n]->ClothingRightArmFile;\r\n\t\t\t\t\tvar->PantsFile = parent_type->VarInfo[var_n]->PantsFile;\r\n\t\t\t\t\tvar->ShoesFile = parent_type->VarInfo[var_n]->ShoesFile;\r\n\t\t\t\t\tvar->WeaponFile = parent_type->VarInfo[var_n]->WeaponFile;\r\n\t\t\t\t\tvar->ShieldFile = parent_type->VarInfo[var_n]->ShieldFile;\r\n\t\t\t\t\tvar->HelmetFile = parent_type->VarInfo[var_n]->HelmetFile;\r\n\t\t\t\t\tvar->FrameWidth = parent_type->VarInfo[var_n]->FrameWidth;\r\n\t\t\t\t\tvar->FrameHeight = parent_type->VarInfo[var_n]->FrameHeight;\r\n\t\t\t\t\tvar->Icon.Name = parent_type->VarInfo[var_n]->Icon.Name;\r\n\t\t\t\t\tvar->Icon.Icon = NULL;\r\n\t\t\t\t\tif (parent_type->VarInfo[var_n]->Animations) {\r\n\t\t\t\t\t\tvar->Animations = parent_type->VarInfo[var_n]->Animations;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar->Construction = parent_type->VarInfo[var_n]->Construction;\r\n\t\t\t\t\tfor (int u = 0; u < VariationMax; ++u) {\r\n\t\t\t\t\t\tvar->UpgradesRequired[u] = parent_type->VarInfo[var_n]->UpgradesRequired[u];\r\n\t\t\t\t\t\tvar->UpgradesForbidden[u] = parent_type->VarInfo[var_n]->UpgradesRequired[u];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar->Tileset = parent_type->VarInfo[var_n]->Tileset;\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int anim_n = 0; anim_n < AnimationFrameMax; ++anim_n) {\r\n\t\t\t\t\t\tif (parent_type->VarInfo[var_n]->ShieldAnimation[anim_n]) {\r\n\t\t\t\t\t\t\tOverlayAnimation *shield_anim = new OverlayAnimation;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar->ShieldAnimation[anim_n] = shield_anim;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tshield_anim->Frame = parent_type->VarInfo[var_n]->ShieldAnimation[anim_n]->Frame;\r\n\t\t\t\t\t\t\tshield_anim->OverlayFrame = parent_type->VarInfo[var_n]->ShieldAnimation[anim_n]->OverlayFrame;\r\n\t\t\t\t\t\t\tshield_anim->XOffset = parent_type->VarInfo[var_n]->ShieldAnimation[anim_n]->XOffset;\r\n\t\t\t\t\t\t\tshield_anim->YOffset = parent_type->VarInfo[var_n]->ShieldAnimation[anim_n]->YOffset;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n```"}}