Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Genghis on March 16, 2010, 10:26:51 pm
-
I submitted a candidate fix patch for bug 2132 (http://scp.indiegames.us/mantis/view.php?id=2132), I attached it to the bug report in Mantis.
I made it so that it simply displays an error message when the cargo limit is exceeded, and then sets the cargo name to blank (z=-1). I wasn't sure whether that was the best approach, or if I should set it to z=0, "Nothing"?
The other thing is that in the patch I added a neat little utility macro I use all the time, to help make the error message more friendly by including the value of MAX_CARGO. Is there a better place for little utility macros and helper functions such as this?
-
This man knows OpenGL! We must obtain him!
-
What does cargo have to do with OpenGL?
But regardless, we could always use skilled programmers. :) Would you be interested in joining or following the SCP?
-
Cargo has nothing to do with it, but he knows OpenGL. Haven't you guys been after an OpenGL coder for a long time?
-
Couldn't you just use sprintf() to output the value instead? That seems to be how the code tends to do things.
-
What does cargo have to do with OpenGL?
Nothing at all :) But I needed to start somewhere and tackling small bugs is always a good way-in to a project.
Couldn't you just use sprintf() to output the value instead? That seems to be how the code tends to do things.
I could have, done yes, although that would cause an extra call to sprintf() every time a ship is updated whereas the macro is all done at compile time. Makes no difference really, this code isn't performance-critical at all so I'm happy to use sprintf() if that's how it's done everywhere else.
-
The fix looks okay to me if I swap a sprintf() for the the macro. Setting it to blank is probably a better idea than setting it to "Nothing" as that actually shows in the game as "Nothing" rather than leaving the cargo a mystery IIRC.
I'll commit this in a bit.
What are you thinking of working on next?
-
I posted a new patch that uses CString.Format, which seems to be the convention in that code (it's already used further down in the same function). You can get it here (http://scp.indiegames.us/mantis/file_download.php?file_id=1448&type=bug).
Next I was thinking of just going through unassigned bugs and cherry-picking ones that don't have too much design debate and which will help me to understand the engine better. I was considering 2151 (http://scp.indiegames.us/mantis/view.php?id=2151) next, since it would help me get to grips with tbl files and so forth. Looking at the available commentary, tbl files appear to be a bit of a dark horror mystery, so I figured it would be a good place for me to go shine a torch.
-
tbl files are in general fairly easy to get to grips with. In this case it's just a matter of a lack of error checking.
So it seems like a pretty good choice. :)