mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge pull request #5733 from MichalZr6/mapeditor_fixes
Mapeditor fixes for various crashes
This commit is contained in:
@@ -29,6 +29,8 @@ class CDefaultObjectTypeHandler : public AObjectTypeHandler
|
||||
|
||||
std::shared_ptr<CGObjectInstance> create(IGameInfoCallback * cb, std::shared_ptr<const ObjectTemplate> tmpl) const final
|
||||
{
|
||||
assert(cb);
|
||||
|
||||
auto result = createObject(cb);
|
||||
|
||||
preInitObject(result.get());
|
||||
@@ -46,6 +48,8 @@ protected:
|
||||
virtual void randomizeObject(ObjectType * object, IGameRandomizer & gameRandomizer) const {}
|
||||
virtual std::shared_ptr<ObjectType> createObject(IGameInfoCallback * cb) const
|
||||
{
|
||||
assert(cb);
|
||||
|
||||
return std::make_shared<ObjectType>(cb);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user