Raised This Month: $ Target: $400
 0% 

ATAC some fix for cs/cz


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 09-25-2011 , 07:05   ATAC some fix for cs/cz
Reply With Quote #1

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
FiFiX is offline
Send a message via Skype™ to FiFiX
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2011 , 07:23   Re: ATAC some fix for cs/cz
Reply With Quote #2

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.
__________________
Arkshine is offline
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 09-25-2011 , 07:30   Re: ATAC some fix for cs/cz
Reply With Quote #3

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?
FiFiX is offline
Send a message via Skype™ to FiFiX
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2011 , 07:35   Re: ATAC some fix for cs/cz
Reply With Quote #4

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 ?
__________________
Arkshine is offline
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 09-25-2011 , 07:49   Re: ATAC some fix for cs/cz
Reply With Quote #5

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.
FiFiX is offline
Send a message via Skype™ to FiFiX
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2011 , 08:41   Re: ATAC some fix for cs/cz
Reply With Quote #6

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.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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