altmp / altv-issues

Issues and roadmap for alt:V project
92 stars 17 forks source link

BaseObjectCreate event is not being called for RmlElement objects #2209

Closed Yiin closed 4 months ago

Yiin commented 5 months ago

Description of the problem

What the title says

Reproduction steps

import * as alt from 'alt-client';

alt.on('baseObjectCreate', (object) => {
    alt.log("Base Object Created", object.constructor.name);
});

const document = new alt.RmlDocument("/client/index.rml");

const node = document.createElement("div");

alt.log("Node", node.constructor.name);
[V8] Starting script client/index.js 
Base Object Created RmlDocument 
Node RmlElement 

Expected behaviour

BaseObjectCreate event should also be called for RmlElement objects, as they do extend BaseObject class.

cpp-sdk:

class IRmlElement : public virtual IBaseObject

Additional context

No response

Operating system

Win11

Version

16.0.0-dev.173

Crashdump ID

No response

Confirmation of issue's presence

FabianTerhorst commented 4 months ago

Fixed in next dev build.

xLuxy commented 4 months ago

On latest dev Version, OnCreateBaseObject method receives nullptr when creating an RML_DOCUMENT - might also be the same for OnRemoveBaseObject

(Basically logging the type inside the methods causes a crash) Crashdump Id: 631f276d-858b-4d88-a4e2-3cf88a2a2087

FabianTerhorst commented 4 months ago

try again when 269 build is done.