View Full Version : Ultimate Freezetime Bug Mid-Round Fix


slmclarengt
04-08-2007, 05:52 PM
Ever been pissed off because you couldn't use your ultimate mid-round because the server stated "You cannot use your ultimate during Freezetime" and after breaking your monitor, you threw your case out the window?

Well, now that you've got a new computer, I've developed a fix for this pestering issue. Although it has not been tested at all (I'm on dial-up ATM and it would take forever to upload to my server :-)), it should work.

First, I will explain my modifications and why exactly they exist.

IN uwc3.sma
FIND
Guests are not allowed to view code.REPLACE
Guests are not allowed to view code.
with
Guests are not allowed to view code.

BECAUSE: It is unnecessary and kryptic to use "World Triggered" as a logged event as it does not relate to the round starting after freezetime. Also, logevent_round_start is a more descriptive and accurate function title.

NEXT, IN uwc3/vars.inl
FIND
Guests are not allowed to view code.
REPLACE with
Guests are not allowed to view code.BECAUSE: It is unnecessary to use an integer for only 2 varying values (it's either 1 or 0) so I switched it to a boolean value (true or false)

NEXT, IN uwc3/utility.inl
FIND
Guests are not allowed to view code.REPLACE with
Guests are not allowed to view code.BECAUSE: we changed freezetime to a boolean value and everything else must be changed in accordance with our declaration.

NEXT, IN uwc3/ultimates.inl
FIND
Guests are not allowed to view code.
PERFORM "REPLACE ALL" function (in wordpad: edit > replace > "Find what: (freezetime==1)" > "Replace with: (freezetime)" > Replace All)
So change all "(freezetime==1)" to "(freezetime)" in whatever way is easiest to you.

BECAUSE: we changed the variable type to boolean

NEXT, IN uwc3/events.inl
FIND
Guests are not allowed to view code.

REPLACE with
Guests are not allowed to view code.

BECAUSE: we changed the variable type to boolean

NEXT, IN uwc3/abilities.inl
FIND
Guests are not allowed to view code.PERFORM "REPLACE ALL" function (in wordpad: edit > replace > "Find what: (freezetime==1)" > "Replace with: (freezetime)" > Replace All)
So change all "(freezetime==1)" to "(freezetime)" in whatever way is easiest to you.

PLEASE let me know if this works or not and let me know if you get any errors/warnings OR ANYTHING at ALL!!! I will fix this bug whether it's the last thing I do :-)!

IN utility.inl FIND
Guests are not allowed to view code.REPLACE with
Guests are not allowed to view code.

Slmclarengt (BnD | Sleeper - www.bndclan.net (http://www.bndclan.net))

Smokey
04-08-2007, 08:32 PM
I would recomend WildEdit - its a program by the same people who make TextPad - I do a lot of my coding in text pad.

Now that I look at this again,

Guests are not allowed to view quotes.

wouldnt it be

find
Guests are not allowed to view code.

becuause if freezetime=1 then its true

but if I see this correctly, you are taking out the int value and replacing with a bool everywhere, but you are only changing the value in one place

Guests are not allowed to view quotes.

So wouldnt it be just a lot easier (although not as pretty) to just change freezetime = 0 and skip all those steps :p[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]

slmclarengt
04-09-2007, 07:55 PM
Yes Smokey, it would be easier to skip the boolean steps and they are completely optional. The reasoning I have is that it's not as good as per code etiquette and reserves a small amount more of memory for processing because integers have many more possibilities than boolean which is one of two values :-).

I write most of my code in AMXX STUDIO but I was using wordpad for some odd reason - probably not at my computer :-). In fact it was Easter and I was with my family not at my own house so that explains it.

Guests are not allowed to view code.freezetime = 1 means that freezetime is on so my code is still accurate because most of the code requires freezetime to be off to work. If you noticed, I may have just put Guests are not allowed to view code. which equates to Guests are not allowed to view code.Hope that clarified things. The attachment in my first post is the bug fix zip file containing ONLY changed files. NOTE: these are from the 1.6.3-133 BETA version and do not contain ANY other modifications.

Slmclarengt

Smokey
04-09-2007, 09:00 PM
I agree with your reasoning, and I wasnt questioning it per se, just trying to determine if I read it correctly :p

But I think you missed my question - you had said:

you had said to find (freezetime==0)

I was just asking if you actually meant find (freezetime==1) instead.

becuase changing (freezetime==0) to (freezetime) changes the value you are looking for, and I dont have any code that has the if(freezetime==1) in my build anywhere in any file, I ONLY have if(freezetime==1)

Hence my confusion :)

slmclarengt
04-09-2007, 09:22 PM
Well smokey, if you check ultimates.inl, you will find Guests are not allowed to view code.

Whereas if you check events.inl, you will find Guests are not allowed to view code.

I'm pretty sure what I wrote in my first post was correct because I was focused on writing my code and understanding it then whereas now I forgot what the hell I did :-).

Slmclarengt

Smokey
04-09-2007, 10:27 PM
Well, that was kind of my point lol, in your instructions you said to find freezetime==0, I was just pointing out that for some of them it would be freezetime==1 :)

no disrespect intended, just a helpfull notation :)

so, correct me if I am wrong here, and I may be:

Guests are not allowed to view quotes.

should be

Guests are not allowed to view quotes.

yes?

my thought process was becuase I had zero lines of code anywhere in the entire uwc3 project that contained
freezetime==0

so that got me thinking and a little confused :p

I could be way off base, but are bare minimum I hope to walk away with some understanding of your mod lol

slmclarengt
04-10-2007, 08:54 AM
Thank you smokey. You were correct, however, I did not understand you in the beginning :-).

Guess I gotta pay a little more attention so those mistakes don't mess everything I do up :-).

Slmclarengt

Smokey
04-10-2007, 10:16 AM
lol, no problems - thanks for being patient with me, I know I dont make a lot of sense some times :p

I have added your bug fix to my code (with comments thanking you for it :)) for the next release - hopefully we can get a shopmenu3 or perhaps some new skills put in as well for the next release :)

Smokey
04-16-2007, 03:49 PM
Just for the record, I did this fix and it doesnt work.

register_logevent("logevent_round_start", 2, "1=Round_Start") //removed "0=world triggered" to fix freezetime issue (see: http://forums.alliedmods.net/showthread.php?t=42159)


Guests are not allowed to view code.

Looks like we need the function too :)

slmclarengt
04-16-2007, 08:31 PM
Lol I forgot about that TINY little detail. I meant to tell you:
IN utility.inl FIND
Guests are not allowed to view code.
REPLACE with
Guests are not allowed to view code.

Slmclarengt

Smokey
04-16-2007, 08:40 PM
lol no worries, it happens to the best of us :)

slmclarengt
06-01-2007, 02:46 PM
Ok. I updated this thread with COMPLETELY verified, tested and correct code changes to reflect this bug fix.

@ Smokey - please integrate this into your newest version... And fix the damn DBI too so that I can use it without it not loading anyones xp :-\.

Slmclarengt

Smokey
06-01-2007, 06:12 PM
lol the DBI problem was because of the problem earlier in the thread that you fixed, I just never updated the code.

I will have to remember to integrate it in on monday.

Good work!

Smokey
06-03-2007, 07:47 PM
I have updated the new beta with that code, the release of 1.6.4 doesnt have it unless you updated the CVS.

(--eRRoR--)
03-05-2009, 10:19 AM
Is this aplied for 1.7.51?Because i noticed that the freeze time doesent owrk(more exactly you can move but not shoot)

Smokey
03-07-2009, 11:23 AM
yes, anything that was in a previous version went on to the next versions as well.

(--eRRoR--)
03-08-2009, 05:28 AM
yes, anything that was in a previous version went on to the next versions as well.
then why doesent it works?

Smokey
03-08-2009, 07:53 PM
it worked fine for me on my server when it was running.

(--eRRoR--)
03-09-2009, 04:26 AM
it worked fine for me on my server when it was running.
Y can make an demo if you want.
And when are you going to finish the mode? :|

Smokey
03-12-2009, 01:17 PM
I havent had time to do anything with it, and there have been no good suggestions on what to do with it, so I cant do anything even if I wanted to, which I dont right now anyways, so it works out :p

The one major thing that anyone can do is to take some of the methods that are done in the uwc3 NG mod and start converting our code to be more like that. This will give us back the vault and sqlite which we are lacking, and it will also update the horribly old and ugly code to the new methods.

I dont want to code anything new until it can be converted into newer and cleaner code. But doing that will take me weeks at the pace I could work on it (an hour a week right now, which I spend doing fun stuff) so if you want to do it, be my guest :)

The sooner that can get done, the sooner I can do the rest of the mod.

(--eRRoR--)
03-13-2009, 03:30 AM
but y dont know coding so god man.Y dont even know wath to do.