diff --git a/app/Http/Controllers/Admin/DeveloperShortcutsController.php b/app/Http/Controllers/Admin/DeveloperShortcutsController.php index 50d6c3ce..f7411f95 100644 --- a/app/Http/Controllers/Admin/DeveloperShortcutsController.php +++ b/app/Http/Controllers/Admin/DeveloperShortcutsController.php @@ -224,6 +224,19 @@ public function createAtCoords(Request $request, PlanetServiceFactory $planetSer return redirect()->back()->with('success', 'Moon deleted successfully at ' . $coordinate->asString()); } + if ($request->has('delete_planet')) { + // Check if there's a moon at these coordinates. + $planet = $planetServiceFactory->makePlanetForCoordinate($coordinate); + + if (!$planet) { + return redirect()->back()->with('error', 'No planet exists at ' . $coordinate->asString()); + } + + // Delete the planet. + $planet->abandonPlanet(); + return redirect()->back()->with('success', 'Planet deleted successfully at ' . $coordinate->asString()); + } + if ($request->has('create_planet')) { // Create planet for current admin user $planetServiceFactory->createAdditionalPlanetForPlayer($player, $coordinate); diff --git a/resources/views/ingame/admin/developershortcuts.blade.php b/resources/views/ingame/admin/developershortcuts.blade.php index 458c5e19..ad4bcc81 100644 --- a/resources/views/ingame/admin/developershortcuts.blade.php +++ b/resources/views/ingame/admin/developershortcuts.blade.php @@ -145,8 +145,9 @@ class="textInput w100 textCenter textBeefy"
- + +