2022-08-09 19:21 EDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002468FSSCPSEXPspublic2011-09-18 01:23
Assigned Toniffiwan 
Product Version3.6.13 
Target VersionFixed in Version3.6.14 RC1 
Summary0002468: Change-Ship-Class does not change armor type
DescriptionPretty straightforward explaination. If you use the change-ship-class sexp to change a ship's class, the armor values of the ship will not be changed. The ship which had the sexp act on it will retain the armor values of the prior class.

This data transfer error may also apply to other data in a ship's class, but that part is only speculation.
Additional InformationA test mod can be found here. Look for the mission in the tech room.

TagsNo tags attached.
Attached Files
  • patch file icon mantis-2468.patch (865 bytes) 2011-09-12 06:16 -
    Index: code/ship/ship.cpp
    --- code/ship/ship.cpp	(revision 7707)
    +++ code/ship/ship.cpp	(working copy)
    @@ -8756,6 +8756,12 @@
     	Assert(sp->ship_max_hull_strength > 0.0f);
     	Assert(objp->hull_strength > 0.0f);
    +	// niffiwan: set new armor types
    +	sp->armor_type_idx = sip->armor_type_idx;
    +	sp->shield_armor_type_idx = sip->shield_armor_type_idx;
    +	sp->collision_damage_type_idx = sip->collision_damage_type_idx;
    +	sp->debris_damage_type_idx = sip->debris_damage_type_idx;
     	// subsys stuff done only after hull stuff is set
     	// if the subsystem list is not currently empty, then we need to clear it out first.
    @@ -16709,4 +16715,4 @@
     void init_path_metadata(path_metadata& metadata)
    \ No newline at end of file
    patch file icon mantis-2468.patch (865 bytes) 2011-09-12 06:16 +




niffiwan (developer)

I've created a patch to transfer the armor (& shield, collision, debris) values to the new ship. My testing with your mod has worked - thanks for providing that.

I've built a binary for you to test with as well, here's the link:

Let me know if there are any problems with it.


niffiwan (developer)

Here's a new link with better filename, and I've 7zip'd it.


bigchunk1 (reporter)

Ok, I was able to test this and it worked. I used two armor types, one essentially invulnerable and one vulnerable. When the missions switched the class of the ship to a 'vulnerable armor' class I was able to destroy the ship. Seems you fixed the issue. What happens now?


niffiwan (developer)

Thanks - I've posted my patch on the forums. If the SCP are happy with it, it should be committed to trunk in the near future.


-Issue History
Date Modified Username Field Change
2011-07-09 01:54 bigchunk1 New Issue
2011-09-10 22:30 niffiwan Assigned To => niffiwan
2011-09-10 22:30 niffiwan Status new => confirmed
2011-09-12 06:16 niffiwan File Added: mantis-2468.patch
2011-09-12 07:14 niffiwan Note Added: 0012814
2011-09-13 09:09 niffiwan Status confirmed => feedback
2011-09-15 06:55 niffiwan Note Added: 0012822
2011-09-16 20:58 bigchunk1 Note Added: 0012824
2011-09-17 07:31 niffiwan Note Added: 0012826
2011-09-18 01:23 Echelon9 Status feedback => resolved
2011-09-18 01:23 Echelon9 Fixed in Version => 3.6.14 RC1
2011-09-18 01:23 Echelon9 Resolution open => fixed
+Issue History