Skip to content

Conversation

TheNormalnij
Copy link
Member

@TheNormalnij TheNormalnij commented Sep 28, 2020

Use first argument object in engineRequestModel to allocate new model. New model will based on trashcan (1337).
Changed valid objects list and this can cause bugs for old scripts. For example, you can't create object with ID 1. New method think that it's a ped.
Valid objects are here

API:

engineRequestModel( "object" )

TEST:

  1. Start test resource
  2. Press "home" button.
  3. This part of map use new allocated ID's

@TheNormalnij TheNormalnij changed the title Allow allocating new objects models using engineRequestModel. Allow allocating new objects models with using engineRequestModel. Sep 28, 2020
@qaisjp
Copy link
Contributor

qaisjp commented Sep 28, 2020

Changed valid objects list and this can cause bugs for old scripts.

If this is a separate bugfix, please can you submit it in a separate pull request?

@qaisjp
Copy link
Contributor

qaisjp commented Sep 28, 2020

Excellent work, by the way :)

@TheNormalnij
Copy link
Member Author

I can't. Without this fix you can't create new objects and change models and textures.

@ghost
Copy link

ghost commented Sep 28, 2020

Thanks for the PR. I skimmed through the code, and it looks good. Testing the PR is going to take some time. I suggest we merge this after 1.5.8.

@StrixG StrixG added the enhancement New feature or request label Sep 29, 2020
@StrixG StrixG added this to the Backlog milestone Sep 29, 2020
@StrixG StrixG changed the title Allow allocating new objects models with using engineRequestModel. Allow allocating new object models using engineRequestModel Sep 30, 2020
@TheNormalnij
Copy link
Member Author

TheNormalnij commented Oct 12, 2020

Thanks you for help, @PlatinMTA !

  1. Crash is fixed.
  2. I can't reproduce.
  3. It's a list with all default object ID's, engineRequestModel will select another ID's.

@TheNormalnij
Copy link
Member Author

Added test resource

Copy link
Contributor

@Inder00 Inder00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like good

Comment on lines +33 to +34
ATOMIC = 1,
TIME = 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh interesting, does gta skip over = 2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTA SA don't use model info with enum 2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or this is special type for parts of destroyed car

@TheNormalnij
Copy link
Member Author

Fixed formatting

@Pirulax
Copy link
Contributor

Pirulax commented Nov 1, 2020

@saml1er #1684 (comment)
It is needed, otherwise his range based for loop woudn't work (with CMappedArray)

Co-authored-by: saml1er <10183157+saml1er@users.noreply.github.com>
@ghost
Copy link

ghost commented Nov 1, 2020

@saml1er #1684 (comment)
It is needed, otherwise his range based for loop woudn't work (with CMappedArray)

In my other review comment, I suggested him to move the code in CClientPedManager. In this way, the method will become shorter, readable, and this won't be needed.
Hmm, I think I get it now why he added it there. Okay.

@ghost ghost merged commit 3f316e4 into multitheftauto:master Nov 3, 2020
@TheNormalnij TheNormalnij deleted the new_objects_allocating branch November 10, 2020 00:42
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants