Showdown often does this thing where after setting up my EVs on a pokemon, I start a battle and the EVs get changed (usually to 4). This isn't the first time this has happened to me, and whatever the problem is happens everytime I try it, if I forfeit the battle, fix the EVs and start a new battle, they just get switched back to that crap. In this case, Magmortar has his attack IVs set to 0, which I think might be somehow related to the problem.
I have added the issue to the known-bugs list. (Also the solution in your side):
Known non-battle Bugs
- After manually editing (typing) the EVs/IVs/Nature/etc of a Pokémon, the change doesn't get saved if you quit the teambuilder screen by pressing the X in the tab while in the Pokémon details screen. Temporary work-around: press the button labeled "< Team" first. Afterwards, close the teambuilder.