mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qw] Fix handling of sky box name
The handling was broken during some merge work. Need to find a good way to unify it all (probably by giving nq a fake serverinfo).
This commit is contained in:
parent
999dd8248b
commit
457306edad
1 changed files with 21 additions and 7 deletions
|
@ -177,15 +177,29 @@ CL_LoadSky (void)
|
|||
{
|
||||
plitem_t *item;
|
||||
const char *name = 0;
|
||||
static const char *sky_keys[] = {
|
||||
"sky", // Q2/DarkPlaces
|
||||
"skyname", // old QF
|
||||
"qlsky", // QuakeLives
|
||||
0
|
||||
};
|
||||
|
||||
if (!cl.worldspawn) {
|
||||
r_funcs->R_LoadSkys (0);
|
||||
return;
|
||||
// R_LoadSkys does the right thing with null pointers.
|
||||
if (cl.serverinfo) {
|
||||
name = Info_ValueForKey (cl.serverinfo, "sky");
|
||||
}
|
||||
if ((item = PL_ObjectForKey (cl.worldspawn, "sky")) // Q2/DarkPlaces
|
||||
|| (item = PL_ObjectForKey (cl.worldspawn, "skyname")) // old QF
|
||||
|| (item = PL_ObjectForKey (cl.worldspawn, "qlsky"))) /* QuakeLives */ {
|
||||
name = PL_String (item);
|
||||
|
||||
if (!name) {
|
||||
if (!cl.worldspawn) {
|
||||
r_funcs->R_LoadSkys (0);
|
||||
return;
|
||||
}
|
||||
for (const char **key = sky_keys; *key; key++) {
|
||||
if ((item = PL_ObjectForKey (cl.worldspawn, *key))) {
|
||||
name = PL_String (item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
r_funcs->R_LoadSkys (name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue