Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Patch] Clothes change
Re: [Patch] Clothes change[message #249501] Fri, 16 April 2010 20:17 Go to previous messageGo to previous message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
You can do a desperate try with the "--binary" command line option on a CR/LF diff file and CR/LF source code files:
patch -p0 --verbose --binary --dry-run < clothes_change.diff

The "--dry-run" option will make the patch program simulate the update without really updating anything and the "verbose" option will show more output. See if it looks better.

Another solution is to have your source code tree in Unix LF text format. The only change is that Windows editors will display source code files on a single line. You can convert them by hand with tools like unix2dos/dos2unix or todos/fromdos but it may not be reasonable to do it on the many (4 ?) source code files that the "change_clothes" patch updates.

You would rather edit your subversion configuration file and change the svn:eol-style property to have this:
### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   
### 
### 
### 
### 
*.c = svn:eol-style=LF
*.cpp = svn:eol-style=LF
*.h = svn:eol-style=LF
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=LF
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=LF

LF for all the source files: *.h, *.cpp and *.c (I doubt there are still .c files in stracciatella).
If you use TortoiseSVN, it's in the menu TortoiseSVN->Settings, where you have a button "Edit Subversion configuration file". The next time you check out from Mythrell's or Tron's repositories, your source code files will be converted to Unix text file format.

To check that it would work, if you wish, instead of the bigger "Clothes change" patch, try on this content before you update your subversion configuration file:

Jake_sells_CAWS_ammo.diff:
Index: Build/Tactical/Arms_Dealer_Init.cc
===================================================================
--- Build/Tactical/Arms_Dealer_Init.cc	(revision 7059)
+++ Build/Tactical/Arms_Dealer_Init.cc	(working copy)
@@ -498,6 +498,16 @@
 		// gas is restocked regularly, unlike most items
 		GuaranteeAtLeastXItemsOfIndex( ARMS_DEALER_JAKE, GAS_CAN, ( UINT8 ) ( 4 + Random( 3 ) ) );
 	}
+	
+	/* mgl: Jake sells CAWS ammo if Maddog was recruited */
+	if (gMercProfiles[MADDOG].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED)
+	{
+		GuaranteeAtLeastXItemsOfIndex(ARMS_DEALER_JAKE,
+		                              Random(2) ? CLIPCAWS_10_SAP
+		                                        : CLIPCAWS_10_FLECH,
+		                              1 + Random(3)
+		                             );
+	}
 
 	//If the player hasn't bought a video camera from Franz yet, make sure Franz has one to sell
 	if( !( gArmsDealerStatus[ ARMS_DEALER_FRANZ ].ubSpecificDealerFlags & ARMS_DEALER_FLAG__FRANZ_HAS_SOLD_VIDEO_CAMERA_TO_PLAYER ) )

This patch is only two lines of code and updates only one file: 'Build/Tactical/Arms_Dealer_Init.cc'.
It makes Jake start to sell clips for the CAWS if you hire Maddog.

You should copy and paste this content to a file 'Jake_sells_CAWS_ammo.diff' at the root of your straciatella source tree as either a CR/LF or LF only text file.

Convert the source code file 'Build/Tactical/Arms_Dealer_Init.cc' to Unix (LF) format with the tool of your choice. As a tip, it should be smaller than originally when converted to unix text format.

Now that you have the diff file in any format and the source code file in LF format, cd to the root of your straciatella tree and type:
patch -p0 --verbose --dry-run < Jake_sells_CAWS_ammo.diff
And watch if it would fail or not. Try to change the text format of the diff file if it fails.

Report message to a moderator

Master Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Patch] Skip militia turns by holding SHIFT
Next Topic: can ja2 stracciatella support other format music???
Goto Forum:
  


Current Time: Sat Jan 25 18:53:33 GMT+2 2025

Total time taken to generate the page: 0.01565 seconds