-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix new vehicle upgrades #3261
base: master
Are you sure you want to change the base?
Fix new vehicle upgrades #3261
Changes from 2 commits
c784154
51d3f67
58d03fc
16ee9b2
d134a80
39fa48b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ bool CVehicleUpgrades::IsUpgradeCompatible(unsigned short usUpgrade) | |
return false; | ||
|
||
unsigned short usModel = m_pVehicle->GetModel(); | ||
|
||
// Wheels should be compatible with any vehicle which have wheels, except | ||
// bike/bmx (they're buggy). Vortex is technically a car, but it has no | ||
// wheels. | ||
|
@@ -80,7 +81,15 @@ bool CVehicleUpgrades::IsUpgradeCompatible(unsigned short usUpgrade) | |
return true; | ||
|
||
bool bReturn = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused variable |
||
switch (usModel) | ||
int model = NULL; | ||
int modelRequestIDParent = g_pGame->GetModelInfo(usModel)->GetParentID(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused variable |
||
if (modelRequestIDParent == 0){ | ||
model = usModel; | ||
}else{ | ||
model = modelRequestIDParent; | ||
} | ||
|
||
switch (model) | ||
{ | ||
case 400: | ||
bReturn = (us == 1020 || us == 1021 || us == 1019 || us == 1018 || us == 1013 || us == 1024 || us == 1008 || us == 1009 || us == 1010); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1435,7 +1435,7 @@ void CVehicleModelInterface_SetClump() | |
{ | ||
// Loop through all vehicles and find the vehicle id that this interface belongs to | ||
CModelInfo* pModelInfo = NULL; | ||
for (int i = 400; i < 612; i++) | ||
for (int i = 400; i < 80000000; i++) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It adds more than one parts. Here you specified only the GTA vehicle ids for (int i = 400; i < 612; i++), but it was not checking when there were more ids, so I increased the number. This is a temporary solution. I could not connect the deatmach file to the multiplayer:sa file to capture the parent id. I did something like this for him and it worked. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is extremely inefficient and can lead to freezes when spawning vehicles. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How else can I prevent it? I already thought of this I put it as a temporary solution and it worked There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can see, there is two possible solutions. The first one is to use one of the associative containers to link model ptr to a model ID at the game's start. And the second one is to store model ID in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tederis |
||
{ | ||
pModelInfo = pGameInterface->GetModelInfo(i); | ||
if (pModelInfo && (DWORD)pModelInfo->GetInterface() == (DWORD)pLoadingModelInfo) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This do same thing, but less code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your expression will produce 1 all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol. I forgot about this in c++. Ty @tederis