mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 16:30:43 +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;
|
plitem_t *item;
|
||||||
const char *name = 0;
|
const char *name = 0;
|
||||||
|
static const char *sky_keys[] = {
|
||||||
|
"sky", // Q2/DarkPlaces
|
||||||
|
"skyname", // old QF
|
||||||
|
"qlsky", // QuakeLives
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
if (!cl.worldspawn) {
|
// R_LoadSkys does the right thing with null pointers.
|
||||||
r_funcs->R_LoadSkys (0);
|
if (cl.serverinfo) {
|
||||||
return;
|
name = Info_ValueForKey (cl.serverinfo, "sky");
|
||||||
}
|
}
|
||||||
if ((item = PL_ObjectForKey (cl.worldspawn, "sky")) // Q2/DarkPlaces
|
|
||||||
|| (item = PL_ObjectForKey (cl.worldspawn, "skyname")) // old QF
|
if (!name) {
|
||||||
|| (item = PL_ObjectForKey (cl.worldspawn, "qlsky"))) /* QuakeLives */ {
|
if (!cl.worldspawn) {
|
||||||
name = PL_String (item);
|
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);
|
r_funcs->R_LoadSkys (name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue