Raised This Month: $12 Target: $400
 3% 

update broke us


Post New Thread Reply   
 
Thread Tools Display Modes
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-29-2013 , 16:12   Re: update broke us
Reply With Quote #11

well if you did use modulus and you only accepted even numbered delimiter pairs, it would by far filter out most "stupid" mistakes, and "bacon sandwich" would fail outright, since it would split into an odd number (1 string)

Also this:

new count = ExplodeString(att, " ; ", atts, 32, 32);

should be:

new count = ExplodeString(att, ";", atts, 32, 32);

As far as I know, atoi discards whitespace leading up to the number, and then discards everything after the nubmer it finds, so I assume stringtoint does the same.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 08-29-2013 at 16:17.
friagram is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 08-29-2013 , 18:04   Re: update broke us
Reply With Quote #12

Quote:
Originally Posted by friagram View Post
and then stringtoint checking if count > 1, you assume pairs, and stringtoint auto sanitizes returning zero (which could also cause the attribute zero problem, but .. oh well)
This actually becomes an issue with how ff2 builds attribute strings for bosses.

Although I'm not sure if the most recent public version does this, but some old version (and my forked version) of the FF2 code will concat a bosses attribs with some hardcoded attribs in the plugin.

So if a boss is being given a weapon with blank attribs, the final string will be something like "2 ; <something> ; 49 ; <somevalue> ; " (attribs completely from memory, but emphasis on the final semicolon and whitespace).

Now when the item code runs through whatever gets exploded, an empty string is passed to StringToInt, and that returns 0 and the code interprets that as attrib 0 and it all explodes.
__________________
VoiDeD is offline
BBG_Theory
Veteran Member
Join Date: Oct 2010
Location: NC USA
Old 08-29-2013 , 18:10   Re: update broke us
Reply With Quote #13

many people have used 25 ; 0 in their bosses config ... why? if this is illegal????
BBG_Theory is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 08-29-2013 , 18:14   Re: update broke us
Reply With Quote #14

Quote:
Originally Posted by BBG_Theory View Post
many people have used 25 ; 0 in their bosses config ... why? if this is illegal????
It's the attrib index that causes the issue, not the attrib value. 25 is the index, 0 is the value. "0 ; 25" would cause issues.
__________________
VoiDeD is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 08-29-2013 , 18:39   Re: update broke us
Reply With Quote #15

Quote:
Originally Posted by VoiDeD View Post
This actually becomes an issue with how ff2 builds attribute strings for bosses.

Although I'm not sure if the most recent public version does this, but some old version (and my forked version) of the FF2 code will concat a bosses attribs with some hardcoded attribs in the plugin.

So if a boss is being given a weapon with blank attribs, the final string will be something like "2 ; <something> ; 49 ; <somevalue> ; " (attribs completely from memory, but emphasis on the final semicolon and whitespace).

Now when the item code runs through whatever gets exploded, an empty string is passed to StringToInt, and that returns 0 and the code interprets that as attrib 0 and it all explodes.
As far as I'm aware, all public versions of FF2 concat hard-coded attributes for melee weapons.

Speaking of public versions, do you have a public source code repo for your version somewhere?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
BBG_Theory
Veteran Member
Join Date: Oct 2010
Location: NC USA
Old 08-29-2013 , 19:07   Re: update broke us
Reply With Quote #16

Quote:
Originally Posted by VoiDeD View Post
It's the attrib index that causes the issue, not the attrib value. 25 is the index, 0 is the value. "0 ; 25" would cause issues.

crap, then I had no violations in any of the boss configs

Last edited by BBG_Theory; 08-29-2013 at 19:51.
BBG_Theory is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 08-30-2013 , 00:35   Re: update broke us
Reply With Quote #17

Quote:
Originally Posted by Powerlord View Post
Speaking of public versions, do you have a public source code repo for your version somewhere?
My version isn't public, but I can probably share specific bits of mine if they're not Trade Secrets™.

Quote:
Originally Posted by BBG_Theory View Post
crap, then I had no violations in any of the boss configs
I think most public boss configs are generally okay, it's the FF2 plugin code that's causing the issues.
__________________

Last edited by VoiDeD; 08-30-2013 at 00:39.
VoiDeD is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 08-30-2013 , 06:51   Re: update broke us
Reply With Quote #18

It concats like 3 attribs.. Damage 2.0, cap rate 2.0 ad fall stomp damage 1.0
When parsing it, it would return 6 values from a null string if concatenated
6%2 is 0...

Quote:
So if a boss is being given a weapon with blank attribs, the final string will be something like "2 ; <something> ; 49 ; <somevalue> ; " (attribs completely from memory, but emphasis on the final semicolon and whitespace).
5%2 is 1.. In this example

So, it would skip it. Though, it should never be concatenating a semicolon at the end... Because it only appends the static prefab string to the custom string (from what i have seen)

I removd this long ago, because bosses with multi weapons would get like +extra cap, and scout bosses onky need +1...

However, this is only done for the boss. The spawn weapon stuff would still cause problems for people.

Fall stomp does not work by the way, ff2 cancels fall damage in ontakedamage hook, therefore nullifying this effect. You could mabye get around this and enable boot stomp and add in the no fall damage attirb from pocket pistol.. I did not try.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 08-30-2013 at 06:58.
friagram 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 17:24.


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