[4fb6b7c] - Inconsistencies with DEFBINDS

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [4fb6b7c] - Inconsistencies with DEFBINDS

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Nash » Fri Apr 24, 2020 6:01 am

Graf Zahl wrote:The idea is to do what Raze does and offer multiple preset configurations but it hasn't been defined yet in GZDoom.

Sweeeeeeeeet. :D

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 2:26 am

That's really weird. It worked out in the end I suppose.

I dunno what was different.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by drfrag » Fri Apr 24, 2020 2:23 am

Well done. For me Control and Shift didn't work due to the name change but i could not reproduce the issue with mouse2 and i was using your test as an iwad.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 2:04 am

My friends always did tell me I was wordy XD

Pleasure helping you fix this Graf.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Graf Zahl » Fri Apr 24, 2020 2:02 am

It could be shortened a bit, but who cares? ;) Yes, this is ok.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 1:57 am

Done and done, boss.

Let me know if it needs to be revised.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Graf Zahl » Fri Apr 24, 2020 1:52 am

Yes, that's correct. Can you copy it to the other loop in there as well? That also needs to be protected. Right now I'm at work and cannot do it myself.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 1:45 am

https://github.com/coelckers/gzdoom/pull/1075

I used the code you supplied and tested it. It doesn't overwrite the settings if it's loaded from a standard WAD or PK3. However, if it loads from an IWAD/IPK3/IPK7, it will.

Tested with the following files:

https://www.dropbox.com/s/0jehjgtq9cs8q ... t.pk3?dl=1 Is just a dummy PK3 with a DEFBINDS in it and nothing more.

https://www.dropbox.com/s/h3193g4rsspad ... .ipk3?dl=1 is an IPK3 with a typical IPK3 setup - DEFBINDS, CVARDEFS, palette, IWADINFO.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 1:37 am

I think I have something that'll work better. I did a test with a dummy PK3 and it doesn't override the settings.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Graf Zahl » Fri Apr 24, 2020 1:28 am

Sure:

Code: Select all

		if (fileSystem.GetFileContainer(i) > fileSystem.GetMaxIwadNum()) ...
If that is true you are in a user mod.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 1:23 am

is there an internal filesystem function that allows me to sort DEFBINDS based on where they came from?

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Graf Zahl » Fri Apr 24, 2020 1:17 am

When reading the bindings file there needs to be an origin check, if it comes from the IWAD or an internal definition it should be allowed, otherwise not.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 1:04 am

Ah, my bad.

This might require someone smarter than me, but it seems the logical thing would be to check and see if the DEFBINDS is being loaded by an IWAD or an IPK3 or an IPK7.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by Graf Zahl » Fri Apr 24, 2020 1:02 am

Sorry, but that's not a proper fix - the protection for user-side bindings needs to be present, otherwise a malicious PWAD can nuke your entire setup.

Re: [4fb6b7c] - Inconsistencies with DEFBINDS

by SanyaWaffles » Fri Apr 24, 2020 12:44 am


Top