summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-14 14:56:50 +0000
committerdominik <dominik@openttd.org>2005-01-14 14:56:50 +0000
commit34db0656315f16852f18f796a3048761ef017d2e (patch)
tree89ddcf9cbbb10f232dd42b1c189d4dc8f2d6125e
parent314a4245a9286ef32e717a70af6d71b136255894 (diff)
downloadopenttd-34db0656315f16852f18f796a3048761ef017d2e.tar.xz
(svn r1506) Fix: [ 1102275 ] Game crashed when clicking "new face" or "company color" twice
-rw-r--r--player_gui.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/player_gui.c b/player_gui.c
index bb5606c95..b262a6675 100644
--- a/player_gui.c
+++ b/player_gui.c
@@ -552,19 +552,19 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
case WE_CLICK:
switch(e->click.widget) {
case 3: { /* select face */
- w = AllocateWindowDescFront(&_select_player_face_desc, w->window_number);
- if (w) {
- w->caption_color = w->window_number;
- WP(w,facesel_d).face = DEREF_PLAYER(w->window_number)->face;
- WP(w,facesel_d).gender = 0;
+ Window *wf = AllocateWindowDescFront(&_select_player_face_desc, w->window_number);
+ if (wf) {
+ wf->caption_color = w->window_number;
+ WP(wf,facesel_d).face = DEREF_PLAYER(wf->window_number)->face;
+ WP(wf,facesel_d).gender = 0;
}
} break;
case 4: {/* change color */
- w = AllocateWindowDescFront(&_select_player_color_desc,w->window_number);
- if (w) {
- w->caption_color = w->window_number;
- w->vscroll.cap = 8;
+ Window *wf = AllocateWindowDescFront(&_select_player_color_desc,w->window_number);
+ if (wf) {
+ wf->caption_color = wf->window_number;
+ wf->vscroll.cap = 8;
}
} break;