AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ATAC some fix for cs/cz (https://forums.alliedmods.net/showthread.php?t=168183)

FiFiX 09-25-2011 07:05

ATAC some fix for cs/cz
 
Since in ATAC topic no one replyed my question I've decided to ask here.

I'm trying to optimize this plugin a little, hooking new round etc.
And I'm wondering what the hell is that fix. What it was supposed to fix anyway? Can someone explain it to me?

Orginal question:
https://forums.alliedmods.net/showpo...&postcount=316

ATAC topic:
https://forums.alliedmods.net/showthread.php?t=61572

Arkshine 09-25-2011 07:23

Re: ATAC some fix for cs/cz
 
Is not self-evident ? You see g_Bomb and EntOwner. You really don't understand what it does ? Just by reading the code it makes sense.

I don't get why you're trying to optimize such plugin. Unless there is major flow, all you will do is pointless.

FiFiX 09-25-2011 07:30

Re: ATAC some fix for cs/cz
 
I don't even know when public Forward_Think( id ) is executed. And it is not self-evident for me.
Why EntOwner[id] = owner if user hasn't got bomb and EntOwner[id] = -1 if he has?

Arkshine 09-25-2011 07:35

Re: ATAC some fix for cs/cz
 
Ok, this function is called when an entity is thinking. The code saves the entity's owner in EntOwner. But there is a special case for the bomb when dropped, it should have no owner. That's why the -1.

Why are you trying to optimize ? You have found a major performance issue or something ?

FiFiX 09-25-2011 07:49

Re: ATAC some fix for cs/cz
 
So the id from Forward_Think( id ) isn't player's id but entity's id correct?
Also can You precise what it means "When entity is thinking?"
And also what for it saves Entity's owner there?

For now, just hooking of new round.

Arkshine 09-25-2011 08:41

Re: ATAC some fix for cs/cz
 
It's a global function, called for all entities which think. So, yes, the entity's index is passed.
An entity is thinking because it requires checks for different purposes. Like when you throw a grenade, you know it explodes after 2,5 seconds, and the "grenade" entity is thinking to check when it should explode.

Look, how you can know what to optimize when you don't even know what you're doing nor understanding such basic code ? What you do doesn't make sense.


All times are GMT -4. The time now is 19:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.