aboutsummaryrefslogtreecommitdiff
path: root/src/fov.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fov.c')
-rw-r--r--src/fov.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/fov.c b/src/fov.c
index bfef858..2ef13e9 100644
--- a/src/fov.c
+++ b/src/fov.c
@@ -24,7 +24,6 @@
#include "ent.h"
#include "event.h"
#include "feature.h"
-#include "gametype.h"
#include "hook.h"
#include "intdefs.h"
#include "langext.h"
@@ -88,8 +87,10 @@ INIT {
if_cold (!cmd_fov) return FEAT_INCOMPAT; // shouldn't happen, but who knows!
if (real_fov_desired = con_findvar("fov_desired")) {
// latest steampipe already goes up to 120 fov
- if (real_fov_desired->parent->maxval == 120) return FEAT_SKIP;
- real_fov_desired->parent->maxval = 120;
+ struct con_var *p = con_getvarcommon(real_fov_desired)->parent;
+ struct con_var_common *c = con_getvarcommon(p);
+ if (c->maxval == 120) return FEAT_SKIP;
+ c->maxval = 120;
}
else {
if (!has_ent) return FEAT_INCOMPAT;
@@ -109,7 +110,7 @@ INIT {
// we might not be using our cvar but simpler to do this unconditionally
fov_desired->cb = &fovcb;
- fov_desired->parent->base.flags &= ~CON_HIDDEN;
+ fov_desired->base.flags &= ~CON_HIDDEN;
// hide the original fov command since we've effectively broken it anyway :)
cmd_fov->base.flags |= CON_DEVONLY;
return FEAT_OK;
@@ -118,10 +119,10 @@ INIT {
END {
if_hot (!sst_userunloaded) return;
if (real_fov_desired && real_fov_desired != fov_desired) {
- real_fov_desired->parent->maxval = 90;
- if (con_getvarf(real_fov_desired) > 90) {
- con_setvarf(real_fov_desired, 90); // blegh.
- }
+ struct con_var *p = con_getvarcommon(real_fov_desired)->parent;
+ struct con_var_common *c = con_getvarcommon(p);
+ c->maxval = 90;
+ if (c->fval > 90) con_setvarf(real_fov_desired, 90); // blegh.
}
else {
void *player = ent_get(1); // also singleplayer only