-
Notifications
You must be signed in to change notification settings - Fork 174
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
[Ready] Respawn functionality #446
Conversation
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.
;)
rwengine/src/ai/PlayerController.hpp
Outdated
bool isWasted(); | ||
bool isBusted(); | ||
|
||
void restartLogic(); |
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.
Some comment would be useful. ;)
rwengine/src/engine/GameState.hpp
Outdated
} | ||
|
||
void addPoliceRestart(const glm::vec4 location) { | ||
policeRestarts.push_back(location); |
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.
To reformat.
@@ -319,8 +319,55 @@ class GameState { | |||
/** Objects created by the current mission */ | |||
std::vector<GameObject*> missionObjects; | |||
|
|||
bool overrideNextStart; | |||
bool overrideNextRestart; |
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.
It should be initialized.
@@ -645,3 +645,9 @@ void CharacterObject::useItem(bool active, bool primary) { | |||
} | |||
} | |||
} | |||
|
|||
void CharacterObject::clearInventory() { | |||
for (int slot = 0; slot < kMaxInventorySlots; ++slot) { |
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.
Range loop?
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.
in this case range loop makes things complicated, because we are getting a value which we need to unpack
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.
You are right, I haven't noticed usage of slot.
rwengine/src/ai/PlayerController.hpp
Outdated
@@ -33,6 +33,11 @@ class PlayerController : public CharacterController { | |||
|
|||
void enterNearestVehicle(); | |||
|
|||
bool isWasted(); | |||
bool isBusted(); |
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.
Maybe todo comment?
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.
Coming along great.
rwengine/src/engine/GameState.hpp
Outdated
int islandOverride; | ||
|
||
if (type == Hospital) { | ||
iter = hospitalRestarts; |
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.
You could avoid copying the list here
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.
Will do
RW_UNUSED(args); | ||
void opcode_016c(const ScriptArguments& args, ScriptVec3 coord, const ScriptFloat heading) { | ||
coord = script::getGround(args, coord); | ||
args.getState()->addHospitalRestart(glm::vec4(coord, heading)); |
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.
Mixing tabs and spaces?
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.
yes, I can fix these exact lines, but whole file should be reformatted anyway
when fail the mission the game dont restart after this merge, looks like gtasa but in gta3 the game restart right ? |
@mythrillex I don't understand what you meant by that |
#443 patch required to make missions failable upon death |
if u kill 8-ball the game will make a respawn loop, restarting the mission over and over, its cause the game dont restart things when start the mission again (example if u break a lampost, when restart the lampost still broken) i think u need remove the weapons when restart or block the shoot action ? |
Yes, you are not supposed to shoot or move or do anything during cutscenes, also when cutscene starts it should clear all projectiles and make player safe. But that's not related to this PR. Maybe I'll do it later. |
Respawning is now handled, related opcodes seemed to work.
Closes #48