main_gui.c
changeset 1962 51ee4f459268
parent 1932 275d72f700e2
child 1977 4392ae3d8e31
--- a/main_gui.c	Tue Jun 21 14:50:08 2005 +0000
+++ b/main_gui.c	Tue Jun 21 16:28:17 2005 +0000
@@ -84,7 +84,7 @@
 			NetworkServer_HandleChat(NETWORK_ACTION_CHAT + (id & 0xFF), id & 0xFF, (id >> 8) & 0xFF, e->edittext.str, NETWORK_SERVER_INDEX);
 		break;
 	case 3: { /* Give money, you can only give money in excess of loan */
-		const Player *p = DEREF_PLAYER(_current_player);
+		const Player *p = GetPlayer(_current_player);
 		int32 money = min(p->money64 - p->current_loan, atoi(e->edittext.str) / GetCurrentCurrencyRate());
 		char msg[20];
 
@@ -329,7 +329,7 @@
 
 static void MenuClickBuildRail(int index)
 {
-	Player *p = DEREF_PLAYER(_local_player);
+	Player *p = GetPlayer(_local_player);
 	_last_built_railtype = min(index, p->max_railtype-1);
 	ShowBuildRailToolbar(_last_built_railtype, -1);
 }
@@ -941,7 +941,7 @@
 
 static void ToolbarBuildRailClick(Window *w)
 {
-	Player *p = DEREF_PLAYER(_local_player);
+	Player *p = GetPlayer(_local_player);
 	Window *w2;
 	w2 = PopupMainToolbMenu(w, 457, 19, STR_1015_RAILROAD_CONSTRUCTION, p->max_railtype);
 	WP(w2,menu_d).sel_index = _last_built_railtype;
@@ -2211,7 +2211,7 @@
 {
 	switch (e->event) {
 	case WE_PAINT: {
-		const Player *p = (_local_player == OWNER_SPECTATOR) ? NULL : DEREF_PLAYER(_local_player);
+		const Player *p = (_local_player == OWNER_SPECTATOR) ? NULL : GetPlayer(_local_player);
 
 		DrawWindowWidgets(w);
 		SetDParam(0, _date);