Conversation
| #[derive(Debug, Error)] | ||
| pub enum ChrAsmError { | ||
| #[error("Invalid slot index")] | ||
| InvalidIndex, |
There was a problem hiding this comment.
Might as well have this store the slot enum and index. May save someone some debugging headache down the line.
| gaitem_lookup_result_get_gaitem_ins_by_category: 0x6727e0, | ||
| gaitem_get_swordarts_param_id_for_weapon: 0x674060, |
There was a problem hiding this comment.
You shouldn't add stuff to this directly... you'll need to add a pattern to mapper-profile.toml to locate it in a way that's hopefully robust across patches and languages, and then use the binary-mapper executable to regenerate the RVA files.
Co-authored-by: Natalie Weizenbaum <nex342@gmail.com>
|
We don't need all these |
|
also functions like |
|
actually, we don't even need them, because no one will ever get this |
That is exactly what I am doing |
|
This code should be part of the mod then |
|
Explain to me the logic of arbitrarily omitting classes used by the actual game, in a library that exists to assist people who mod the game, which typically involves hooking functions which make use of those classes |
| #[repr(C)] | ||
| pub struct GaitemLookupResult { | ||
| pub gaitem_handle: GaitemHandle, | ||
| _pad: [u8; 4], |
There was a problem hiding this comment.
This padding can be removed without changing the offset of gaitem_ins I think. We generally don't put down padding anymore
|
|
||
| impl GaitemLookupResult { | ||
| // Retrieves a valid CSGaitemIns from a GaitemHandle if it matches item_category. | ||
| fn get_gaitem_ins_by_category(&self, handle: &GaitemHandle, item_category: ItemCategory) -> Option<&CSGaitemIns> { |
There was a problem hiding this comment.
Is this something that can currently be done with existing code instead? If not we should change the param structures to allow for it.
At any rate, we should prob remove these until we have consensus on helpers (you can impl these fns on your own end with an Ext trait in the meanwhile).
There was a problem hiding this comment.
also, this should be GaitemCategory, not ItemCategory
| self.get_arrow_by_slot(self.equipment.selected_slots.left_bolt_slot) | ||
| .expect(&*ChrAsmError::InvalidIndex.to_string()) | ||
| } | ||
| pub fn get_right_weapon_by_slot(&self, slot: u32) -> Result<GaitemHandle, ChrAsmError> { |
There was a problem hiding this comment.
We can make the slot param an enum to ensure no value greater than 2 is passed in. This way we can remove the error handling entirely.
|
|
||
| impl GaitemLookupResult { | ||
| // Retrieves a valid CSGaitemIns from a GaitemHandle if it matches item_category. | ||
| fn get_gaitem_ins_by_category(&self, handle: &GaitemHandle, item_category: ItemCategory) -> Option<&CSGaitemIns> { |

Shoving this PR in here with a bunch of random crap I've been adding over time to work on the Reforged DLL.
Probably garbage and needs a review