From 2203bae81f9a746af40fc500502017a3940c3edf Mon Sep 17 00:00:00 2001 From: Hipposgrumm <60556345+Hipposgrumm@users.noreply.github.com> Date: Wed, 10 Jul 2024 02:10:55 -0600 Subject: [PATCH] Fixed Math Blaster's mutt textures. (#6) Will now set to appropriate mutt texture if pet is using a larva texture and is older than HATCHING. The pet data saving code will now set to appropriate mutt texture if pet is using a larva texture and is older than HATCHING. This fixes the issue that mutts were using their old larva's texture instead of the mutt's default texture. Any existing mutts using the wrong texture will have it changed when the pet is saved (not when loaded). For users to see the fixed texture they would need to restart the game after the affected mutt(s)' data changed in any way (or otherwise saved to the server). --- src/Controllers/Common/ContentController.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index fda1135..897b2e9 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -622,7 +622,7 @@ public class ContentController : Controller { [HttpPost] [Produces("application/xml")] - [Route("ContentWebService.asmx/SetRaisedPet")] // used by World Of Jumpstart + [Route("ContentWebService.asmx/SetRaisedPet")] // used by World Of Jumpstart and Math Blaster [VikingSession] public IActionResult SetRaisedPetv1(Viking viking, [FromForm] string raisedPetData) { RaisedPetData petData = XmlUtil.DeserializeXml(raisedPetData); @@ -633,6 +633,17 @@ public class ContentController : Controller { return Ok(false); } + if (petData.Texture.StartsWith("RS_SHARED/Larva.unity3d/LarvaTex") && petData.GrowthState.GrowthStateID>4) { + petData.Texture = "RS_SHARED/" + petData.PetTypeID switch { + 5 => "EyeClops.unity3d/EyeClopsBrainRedTex", // EyeClops + 6 => "RodeoLizard.unity3d/BlueLizardTex", // RodeoLizard + 7 => "MonsterAlien01.unity3d/BlasterMythieGreenTex", // MonsterAlien01 + 11 => "SpaceGriffin.unity3d/SpaceGriffinNormalBlueTex", // SpaceGriffin + 10 => "Tweeter.unity3d/TweeterMuttNormalPurple", // Tweeter + _ => "null" // Anything with any other ID shouldn't exist. + }; + } + dragon.RaisedPetData = XmlUtil.SerializeXml(UpdateDragon(dragon, petData)); ctx.Update(dragon); ctx.SaveChanges();