You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import*asaltfrom'alt-server'classMyVehicleextendsalt.Vehicle{test(){returntrue}}// this breaks the prototype after resource restartalt.Vehicle.allalt.Vehicle.prototype=MyVehicle.prototypeconstveh=newalt.Vehicle('sultan2',10000,0,0,0,0,0)// undefined after resource restartconsole.log('veh.test():',veh.test?.())// false after resource restartconsole.log('veh instanceof MyVehicle:',vehinstanceofMyVehicle)// will be false tooconsole.log('veh instanceof alt.Vehicle:',vehinstanceofalt.Vehicle)// [ Entity {}, Entity {} ] after resource restartconsole.log(alt.Vehicle.all)
Restart resource
Expected behaviour
Prototype overwrite should work as usual after each restart
Then this is a problem with the general approach of the system used to define classes inside JS module. And I can already say that won't be reworked any time soon, as it would be way too much work.
Description of the problem
See reproduction steps
Reproduction steps
Expected behaviour
Prototype overwrite should work as usual after each restart
Additional context
Possible workaround
or set prototype explicitly on each object:
Operating system
Windows 10
Version
dev/9.0-dev8
Scope
shared
The text was updated successfully, but these errors were encountered: