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).
This commit is contained in:
Hipposgrumm 2024-07-10 02:10:55 -06:00 committed by Robert Paciorek
parent 9993198a9b
commit 2203bae81f

View File

@ -622,7 +622,7 @@ public class ContentController : Controller {
[HttpPost] [HttpPost]
[Produces("application/xml")] [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] [VikingSession]
public IActionResult SetRaisedPetv1(Viking viking, [FromForm] string raisedPetData) { public IActionResult SetRaisedPetv1(Viking viking, [FromForm] string raisedPetData) {
RaisedPetData petData = XmlUtil.DeserializeXml<RaisedPetData>(raisedPetData); RaisedPetData petData = XmlUtil.DeserializeXml<RaisedPetData>(raisedPetData);
@ -633,6 +633,17 @@ public class ContentController : Controller {
return Ok(false); 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)); dragon.RaisedPetData = XmlUtil.SerializeXml(UpdateDragon(dragon, petData));
ctx.Update(dragon); ctx.Update(dragon);
ctx.SaveChanges(); ctx.SaveChanges();