Horrible code duplication in AGameModeBase in 4.14.0

Hi Epics!

First of all I love what you do and please don’t take my post as whining but… I’ve been eagerly waiting to lay my hands on refactored GameMode class for better spawning and such, and I’m supprised to find that AGameModeBase::RestartPlayerAtPlayerStart and AGameModeBase::RestartPlayerAtTransform are horrible copy-pastes. I mean: You Are Epic, but… this? :wink: Would you accept a merge request from me that cleans that up or your eyes hurt so much looking at that code that you’ll wipe it off clean before anybody else notices? :wink:

Best Regards,
AH

Ok, I get it ;-).

Which branch do I have to sent a pull request to: “release” or “4.14” ?

Submit to master. Also, you should post this on Answerhub. Devs never really post in the C++ section.

Also, it might not be a bad thing for these functions to be separated. You can implement special behaviour then depending on where the player spawns.

Thanks, good. Yeah, these functions make sense both, but not as a copy-paste. I’ll try to clean it up, leaving both of them but much more DRY.

Feel free to cleanup the two versions of InitNewPlayer() as well while you’re at it… that really grated on me last release. One just calls the other…