Grrr ... find the humor ...
Moderator: InsideQC Admins
11 posts
• Page 1 of 1
Grrr ... find the humor ...
This is in the Kurok PSP source, not surprisingly ... it doesn't actually work. But I didn't notice and was wondering why the KurokPSP wasn't doing what I expected.
- Code: Select all
// Tomaz - QC Alpha Scale Glow Begin
{
eval_t *val;
alpha=1;
scale=1;
if (val == GetEdictFieldValue(ent, "alpha"))
{
alpha = val->_float;
}
else
alpha = 1;
if (val == GetEdictFieldValue(ent, "scale"))
{
scale = val->_float;
}
else
scale = 1;
if (scale > 4)
scale = 4;
.
.
.
}
// Tomaz - QC Alpha Scale Glow End
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Re: Grrr ... find the humor ...
Missing {} for the last if? I am guessing wildly, QuakeC's rules confuse me since I never really did anything in it. 
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Its C, not C++, and {} works the same way - not needed if it would contain a single line (or rather a single semi-colon.... unless its a control statement in which case its allowed multiple... you know what, I'm just gonna shut up now).
Have another go. :)
Have another go. :)
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Just took a quick look, but looks like nobody is initializing val before it's being referenced, correct ?
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Didn't see alpha or scale declared. Also, if it's wrong, let it be wrong more efficiently:
Maybe check alpha >=0 and <=1? Check scale >0?
- Code: Select all
// Tomaz - QC Alpha Scale Glow Begin
{
eval_t *val;
alpha=1;
scale=1;
if (val == GetEdictFieldValue(ent, "alpha"))
alpha =val->_float;
if (val == GetEdictFieldValue(ent, "scale"))
{
scale = val->_float;
if (scale > 4)
scale = 4;
}
.
.
.
}
// Tomaz - QC Alpha Scale Glow End
Maybe check alpha >=0 and <=1? Check scale >0?
-
qbism - Posts: 1236
- Joined: Thu Nov 04, 2004 5:51 am
The compiler would complain about undeclared vars, but it may fail to detect references to a non-initialized pointer. Anyway, this comes exactly to reforce my point: people should at least try to understand what they're doing when doing Ctrl+C/Ctrl+V. It's very likely that someone pasted that at some point, the change obviously didn't work, and he/she didn't bother to revert things. :/
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
metlslime wrote:== should be =
Dammit you're right. I've been scratching my head over that one!
Probably intended to be something like this:
- Code: Select all
if ((val = GetEdictFieldValue(ent, "alpha")) != NULL)
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
I thought I need a custom protocol to integrate true Kurok support the way the author presented it!
I don't.
It was never working to begin with. Yeah, Spike obviously nailed it on reply #1 with Metlslime saying the answer, but I actually "fixed" the code with = and got endless crashes not realizing I had "fixed" what had never been operational.
So tasks -1. Kurok was not using a custom protocol on the PSP.
I don't.
It was never working to begin with. Yeah, Spike obviously nailed it on reply #1 with Metlslime saying the answer, but I actually "fixed" the code with = and got endless crashes not realizing I had "fixed" what had never been operational.
So tasks -1. Kurok was not using a custom protocol on the PSP.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest