Copy mission parameters properly so that D1 missions load

Copying unrelated structures with an undocumented assumption that one is
a prefix of the other is dangerous and broken.  Remove it and copy the
relevant fields explicitly.
This commit is contained in:
Kp 2013-08-18 20:58:52 +00:00
parent a04cd57d71
commit 948e03dcbf

View file

@ -730,7 +730,10 @@ int load_mission(mle *mission)
free_mission();
MALLOC(Current_mission, Mission, 1);
if (!Current_mission) return 0;
*(mle *) Current_mission = *mission;
Current_mission->builtin_hogsize = mission->builtin_hogsize;
strcpy(Current_mission->mission_name, mission->mission_name);
Current_mission->descent_version = mission->descent_version;
Current_mission->anarchy_only_flag = mission->anarchy_only_flag;
Current_mission->path = d_strdup(mission->path);
Current_mission->filename = Current_mission->path + (mission->filename - mission->path);
Current_mission->n_secret_levels = 0;