Skip to content

Commit

Permalink
add IVehicle::SetFixed
Browse files Browse the repository at this point in the history
Former-commit-id: d86c572
  • Loading branch information
martonp96 committed Dec 5, 2020
1 parent a31e085 commit 63adbf5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/bindings/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ extern V8Class v8Vehicle("Vehicle", v8Entity, Constructor, [](v8::Local<v8::Func
proto->Set(v8::String::NewFromUtf8(isolate, "setArmoredWindowShootCount"), v8::FunctionTemplate::New(isolate, &SetArmoredWindowShootCount));
proto->Set(v8::String::NewFromUtf8(isolate, "getDamageStatusBase64"), v8::FunctionTemplate::New(isolate, &GetDamageStatus));
proto->Set(v8::String::NewFromUtf8(isolate, "setDamageStatusBase64"), v8::FunctionTemplate::New(isolate, &SetDamageStatus));
proto->Set(v8::String::NewFromUtf8(isolate, "setFixed"), v8::FunctionTemplate::New(isolate, &SetFixed));

//Script getters/setters
proto->SetAccessor(v8::String::NewFromUtf8(isolate, "manualEngineControl"), &ManualEngineControlGetter, &ManualEngineControlSetter);
Expand Down
12 changes: 12 additions & 0 deletions src/bindings/vehicle/Damage.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,18 @@ namespace V8::Vehicle
vehicle->LoadDamageDataFromBase64(*damageStatus);
}

void SetFixed(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();

V8Entity* _this = V8Entity::Get(info.This());
V8_CHECK(_this, "entity is invalid");

Ref<IVehicle> vehicle = _this->GetHandle().As<IVehicle>();

vehicle->SetFixed();
}

void GetDamageStatus(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();
Expand Down
2 changes: 1 addition & 1 deletion src/cpp-sdk
Submodule cpp-sdk updated 2 files
+3 −1 ICore.h
+1 −1 objects/IVehicle.h
2 changes: 1 addition & 1 deletion src/helpers

0 comments on commit 63adbf5

Please sign in to comment.