Implementing Plane Speed Patch Code into 0.5.1 Code

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Implementing Plane Speed Patch Code into 0.5.1 Code

Post by chrissicom »

Hi there, I am currently trying to implement benbens panespeed patch in the 0.5.1 codebase which I've downloaded which works fine except for two files

settings.c and settings_gui.c

Their code seems to have changed quite a lot since benben made his patch file, so I don't know how I can add the below bit of code and where

Code: Select all

Index: settings.c
===================================================================
--- settings.c	(revision 2349)
+++ settings.c	(working copy)
@@ -876,6 +876,7 @@
 	{"realistic_acceleration",SDT_BOOL, (void*)false,	&_patches.realistic_acceleration,	NULL},
 	{"forbid_90_deg",				SDT_BOOL, 	(void*)false, &_patches.forbid_90_deg,					NULL},
 	{"improved_load",				SDT_BOOL,		(void*)false,	&_patches.improved_load,				NULL},
+	{"plane_speed_coeff",	SDT_UINT8,	(void*)1,	&_patches.plane_speed_coeff,	NULL},
 
 	{"max_trains",					SDT_UINT16,	(void*)500,		&_patches.max_trains,						NULL},
 	{"max_roadveh",					SDT_UINT16,	(void*)500,		&_patches.max_roadveh,					NULL},
Index: settings_gui.c
===================================================================
--- settings_gui.c	(revision 2349)
+++ settings_gui.c	(working copy)
@@ -731,6 +731,8 @@
 
 	{PE_BOOL,		0, STR_CONFIG_PATCHES_SMOOTH_ECONOMY,		"smooth_economy", &_patches.smooth_economy,						0,  0,  0, NULL},
 	{PE_BOOL,		0, STR_CONFIG_PATCHES_ALLOW_SHARES,			"allow_shares", &_patches.allow_shares,						0,  0,  0, NULL},
+
+	{PE_UINT8, PF_NOCOMMA, STR_CONFIG_PATCHES_PLANE_SPEED_COEFF, "plane_speed_coeff", &_patches.plane_speed_coeff, 1, 8, 1, NULL},
 };
 
 static const PatchEntry _patches_ai[] = {
in settings.c I've added the following below the realistic_accerleration line for the trains

Code: Select all

SDT_BOOL(Patches, plane_speed_coeff,   SLE_UNIT8,0, 0, 1,						 STR_CONFIG_PATCHES_PLANE_SPEED_COEFF,	  NULL),
but I am not sure if this is correct... and I am totally lost as to how to add benbens patch code to the settings_gui.c file
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Post by TheJosh »

If I was doing this, I would try to work out what settings were originally created, their default values, etc, And then try to rebuild the settings with the new codebase.

check out
http://wiki.openttd.org/index.php/OpenT ... atchOption
thats the docs on adding a patch option.

Have fun!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 35 guests