mirror of
				https://github.com/tobspr/shapez.io.git
				synced 2025-06-13 13:04:03 +00:00 
			
		
		
		
	Fix hub being removable after restoring a game, fix tslint errors
This commit is contained in:
		
							parent
							
								
									a1fd83c03c
								
							
						
					
					
						commit
						b64bbc8132
					
				| @ -26,7 +26,7 @@ export class MetaMinerBuilding extends MetaBuilding { | ||||
|      * @param {Entity} entity | ||||
|      */ | ||||
|     setupEntityComponents(entity) { | ||||
|         entity.addComponent(new MinerComponent({})); | ||||
|         entity.addComponent(new MinerComponent()); | ||||
|         entity.addComponent( | ||||
|             new ItemEjectorComponent({ | ||||
|                 slots: [{ pos: new Vector(0, 0), direction: enumDirection.top }], | ||||
|  | ||||
| @ -4,4 +4,8 @@ export class UnremovableComponent extends Component { | ||||
|     static getId() { | ||||
|         return "Unremovable"; | ||||
|     } | ||||
| 
 | ||||
|     static getSchema() { | ||||
|         return {}; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -77,7 +77,7 @@ export class Entity extends BasicSerializableObject { | ||||
|     static getSchema() { | ||||
|         return { | ||||
|             uid: types.uint, | ||||
|             components: types.keyValueMap(types.objData(gComponentRegistry), false), | ||||
|             components: types.keyValueMap(types.objData(gComponentRegistry)), | ||||
|         }; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -20,7 +20,6 @@ import { Savegame } from "../savegame/savegame"; | ||||
| import { GameLogic } from "./logic"; | ||||
| import { ShapeDefinitionManager } from "./shape_definition_manager"; | ||||
| import { CanvasClickInterceptor } from "./canvas_click_interceptor"; | ||||
| import { PerlinNoise } from "../core/perlin_noise"; | ||||
| import { HubGoals } from "./hub_goals"; | ||||
| import { BufferMaintainer } from "../core/buffer_maintainer"; | ||||
| import { ProductionAnalytics } from "./production_analytics"; | ||||
|  | ||||
| @ -128,7 +128,6 @@ export class SavegameSerializer { | ||||
|         if (!verifyResult.result) { | ||||
|             return ExplainedResult.bad(verifyResult.reason); | ||||
|         } | ||||
|         console.log("SAVEGAME:", savegame); | ||||
|         let errorReason = null; | ||||
| 
 | ||||
|         errorReason = errorReason || root.entityMgr.deserialize(savegame.entityMgr); | ||||
|  | ||||
| @ -18,10 +18,9 @@ | ||||
|  *   camera: any, | ||||
|  *   time: any, | ||||
|  *   entityMgr: any, | ||||
|  *   entities: { | ||||
|  *     resources: Array<SerializedMapResource>, | ||||
|  *     buildings: Array<any> | ||||
|  *   } | ||||
|  *   map: any, | ||||
|  *   hubGoals: any, | ||||
|  *   entities: Array<any> | ||||
|  * }} SerializedGame | ||||
|  */ | ||||
| 
 | ||||
|  | ||||
| @ -33,12 +33,8 @@ export class SerializerInternal { | ||||
|      */ | ||||
|     deserializeEntityArray(root, array) { | ||||
|         for (let i = 0; i < array.length; ++i) { | ||||
|             const errorState = this.deserializeEntity(root, array[i]); | ||||
|             if (errorState) { | ||||
|                 return errorState; | ||||
|             } | ||||
|             this.deserializeEntity(root, array[i]); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
| @ -67,10 +67,6 @@ export class InGameState extends GameState { | ||||
|         this.savegame; | ||||
| 
 | ||||
|         this.boundInputFilter = this.filterInput.bind(this); | ||||
| 
 | ||||
|         if (G_IS_DEV) { | ||||
|             window.performSave = this.doSave.bind(this); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user