Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't let campaign levels be deleted #523
Before deleting a level, the server will check to see if the level is in a Campaign. If it is, it won't let the user delete the level.
This has happened before. While it's not a common thing (it's only happened about 1-5 times in PR2's history), I think it's probably best to have this check to save you the trouble of having to restore it if it happens. Just in case; especially with new Campaign levels every month from Campaign of the Month!
(I also can't test this without making tons of dummy levels on my localhost, so just take a gander and make sure everything looks up to par.)
Also, please run this query on the database:
UPDATE `pr2_levels` SET `live` = "1" WHERE `level_id` = 1442589;
EDIT: To be clear, this protects against a level being deleted via the