ramiismail / dopresskit

presskit() - spend time making games, not press.
GNU General Public License v3.0
137 stars 50 forks source link

create.php checks for data.xml in an images directory? #32

Open dafrancis opened 9 years ago

dafrancis commented 9 years ago

I'm confused about a certain line in create.php

https://github.com/ramiismail/dopresskit/blob/master/archive/create.php#L335

From what I understand the code works something like this (I'm using pseudocode here):

if (upgrade) {
    ...
    // Show the todo list for upgrading
    ...
} else if (installation) {
    ...
    // Show the todo list for installation
    ...
} else {
    // It's a game page
    if (game_data_xml_exists) {
        // Finished!!!
    } else {
        // Show todo list for game page
        if (there_is_a_data_xml_file_in_images_directory) { // <-- WTF?
            // Finished!!!
        } else if (required_done) {
            // final step asking to change _data.xml to data.xml
        }
    }
}

What I don't understand is why data.xml would be in the images directory. There's no other code that reads this later on.

Also, if this meant to be the data.xml file in the game directory then that puzzles me even more, since that would go to the other branch of the if statement (the first "// Finished!!!" in the code above).

Is this intentional or accidental? As far as I can see, this won't actually cause any errors but it does add some cruft to the code which threw me off.

paulcanning commented 7 years ago

With the state of some of the code, I'd say it's just an error.