ttyborg / castlesand

Automatically exported from code.google.com/p/castlesand
0 stars 0 forks source link

Seg Fault on RXXPacker #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Checkout SVN source to empty directory.
2. Copy files from KaM TPR\data\gfx to Remake\data\gfx, not directories.
3. Copy files from KaM TPR\data\defines to Remake\data\defines
4. Copy sounds.dat from KaM TPR\data\sfx to Remake\data\sfx
5. Compile RXXPacker with Lazarus 1.0.6
6. Run from Lazarus
7. Select all packages and click [Pack to RXX File]

What is the expected output? What do you see instead?
The RXXPacker takes the original .rx files and inserts modified sprites in 
them. This does not happen: it crashes on Houses, namely

Raised exception 'SIGSEGV' on
KM_ResourceHouse.pas at line 591:
  Result := fHouseType in [HOUSE_MIN..HOUSE_MAX];

Caleld from KM_ResourceSpritesEdit.pas at line 178:
  if aHouseDat[HT].IsValid then

Called from RXXPackerForm.pas at line 124:
        SpritePack.AdjoinHouseMasks(HouseDat);

Breaking change from (revision 4685), all occurences from Low and High are 
replaced by HOUSE_MIN and _MAX:
- Low(THouseType) to High(THouseType)
+ HOUSE_MIN to HOUSE_MAX

Fix:

KM_ResourceSpritesEdit.pas on line 177:

-  for HT := Low(THouseType) to High(THouseType)
+  for HT := HOUSE_MIN to HOUSE_MAX do

KM_ResourceSpritesEdit.pas on line 220:

-  for HT := Low(THouseType) to High(THouseType)
+  for HT := HOUSE_MIN to HOUSE_MAX do

Another small note: GUIMainH.rx does not exists in my KaM distribution.

Original issue reported on code.google.com by send.to....@gmail.com on 12 Mar 2013 at 8:40

GoogleCodeExporter commented 9 years ago
Fixed, thanks for reporting.

Original comment by lewinjh@gmail.com on 12 Mar 2013 at 12:00