PDA

View Full Version : VenRob as Proper Dev



ZoriaRPG
10-31-2018, 12:31 AM
Grayswandir

Gleeok

jman2050

Given how helpful Rob has been, that he has become familiar-enough with the source, git, and the tools to work on ZC to the extent of adding new features without aid, and his willingness to do builds, I'd like to elevate him to full dev status.

He seems to have gotten the rules on doing merges in his head, and is now being more careful, so I think that won't be an issue--although I won't be giving him ownership on the repo, just merge access.

What are your thoughts here?

(Given that jman is pseudo-retired, if he doesn't respond, that's fine.)

I'm pretty sure that ultimately, it's my call here, but I want to gather your thoughts on this, before I do anything.

Gleeok
11-01-2018, 06:37 AM
I'm glad someone new is interested in working on ZC. That is good news! :)

Yeah, I've noticed he's been working on various things recently and that you were helping him along, although I haven't looked at any of the commits; I guess I'll do that right now.

...Well that didn't take long.

The last commit was a two-line fix:


- //m->initd[(ri->d[0]/10000)][(ri->d[1]/10000)] = (value/10000);
+ m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;


Correct me if I'm wrong, but that looks like overflow to me. :P ...or did I just get (un)lucky with my timing?

ZoriaRPG
11-02-2018, 09:43 AM
I'm glad someone new is interested in working on ZC. That is good news! :)

Yeah, I've noticed he's been working on various things recently and that you were helping him along, although I haven't looked at any of the commits; I guess I'll do that right now.

...Well that didn't take long.

The last commit was a two-line fix:


- //m->initd[(ri->d[0]/10000)][(ri->d[1]/10000)] = (value/10000);
+ m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;


Correct me if I'm wrong, but that looks like overflow to me. :P ...or did I just get (un)lucky with my timing?

No overflow? That's an InitD function. The value was being divided and multiplied when it should not have been, and the ffc index wasn't properly offset. Both my fault, and I sent him a text file with the patch, that he committed while my laptop was in surgery.

Both InitD and MiscD are always a raw values, and I forgot that here, when I wrote 300 ZScript commands all at once. All refinfo registers are also always raw.

Off-topic, but my plans this week are to finish uop bitmaps, fix script drawing stuff--cset2 related-- and to ffix some other critical bugs. I'm going to start on npc script stuff soon, as well. I need to get bitmap->Blit(dest,args) and some basic draw commands in for bitmaps, so that I can test if bitmap->Create(h,w) works as I intend.

I finally got that in there in the most straightforward manner possible.

Anyway, he's doing a good job, seems dedicated, and his outpit is constructive.

Gleeok
11-02-2018, 07:56 PM
Well, maybe I am hallucinating or something, but what's to stop refInfo.d[] from being less than 1...?

m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;

Is this valid?

ZoriaRPG
11-03-2018, 11:06 AM
Well, maybe I am hallucinating or something, but what's to stop refInfo.d[] from being less than 1...?

m->initd[(ri->d[0]/10000) - 1][(ri->d[1]/10000)] = value;

Is this valid?

Oh dear, it looks like that one is indeed missing a sanity bound. It should have two, in fact.

Specifically, it needs this:



int ffid = (ri->d[0]/10000)-1;
int indx = ri->d[1]/10000;

if ( ffid < 0 || ffid > 31 )
{
Z_scripterrlog("Invalid FFC id passed to mapdata->FFCInitD[]: %d",ffid);
}
else if ( indx < 0 || indx > 7 )
{
Z_scripterrlog("Invalid InitD[] index passed to mapdata->FFCInitD[]: %d",indx);
}
else
{
m->initd[ffid][(ri->d[indx] = value;
}


One of these days I'll add some more boundscheck inline functions for this sort of thing.

Gleeok
11-03-2018, 09:57 PM
Here's a little trick for bounds checks:



if(a < 0 || a >= MAX) { error }; //instead of this,

if((unsigned)a >= MAX) //compile time optimization


Back on topic, I was really only looking at his code for safety and bugs, which is basically the main prerequisite for write access.

ZoriaRPG
11-05-2018, 03:05 PM
Here's a little trick for bounds checks:



if(a < 0 || a >= MAX) { error }; //instead of this,

if((unsigned)a >= MAX) //compile time optimization


Back on topic, I was really only looking at his code for safety and bugs, which is basically the main prerequisite for write access.


Good point, and fixed. Anyway, this was my oversight. Rob has been helping me test, and prove some of the new stuff, and informing me of any issues. He applied the patch at my instruction, and I forgot to include the same BC as with the other related instructions. (These two are special, as they're commands, not variables.)

https://github.com/ArmageddonGames/ZeldaClassic/commit/9716c88a2bac1dcd36bd870156719abba2cd9489

Gleeok
11-06-2018, 03:27 AM
Aha, got you red handed!!! :P

So yeah, his stuff looks pretty good. Go ahead and give him write access. Sounds like a plan.