CleverRaven/Cataclysm-DDA — pull request #5524 by BevapDin (2014-01-12 21:56:52+00:00)
Title: Fix crash on newchar

Apparently `player::reset` calls `player::suffer` which accesses the map - which has not yet loaded the correct submaps - because actually the player has no valid position at all (posx and posy are seemingly uninitialized and might contain about anything).

@kevingranade thanks for the backtrace - it didn't crash on my system.

For me this triggered the INBOUNDS checks in map.cpp which prevents a crash, but if the position is (by pure luck) a valid position in the map (like 0,0), it will access `map::grid[]` which is all `NULL` as no submaps have been loaded.

This removes the call to `player::reset` and replaces it with `u = player()` which assigns a new, default initialized player object. This is essentially a reset.

Btw. the bug can be triggered if one initializes posx and posy in `player::player` to 0.

fixes #5521