laverdet / xxscreeps

Other
71 stars 16 forks source link

Unable to make Rampart public #35

Open connorshea opened 3 years ago

connorshea commented 3 years ago
  1. Create a section of wall with a one tile hole
  2. Create a rampart in that one tile hole
  3. Click the rampart
  4. Click "Make public"
  5. Get error in console running xxscreeps
Unhandled error. Endpoint: /api/game/add-object-intent
 /Users/connorshea/code/xxscreeps/src/backend/endpoints/game/intents.ts:20
            throw new TypeError('Invalid parameters');
                  ^

TypeError: Invalid parameters
    at Object.execute (/Users/connorshea/code/xxscreeps/src/backend/endpoints/game/intents.ts:20:10)
    at null.<anonymous> (/Users/connorshea/code/xxscreeps/src/backend/endpoints/index.ts:23:33)
    at dispatch (/Users/connorshea/code/xxscreeps/node_modules/koa-compose/index.js:42:32)
    at /Users/connorshea/code/xxscreeps/node_modules/koa-router/lib/router.js:372:16
    at dispatch (/Users/connorshea/code/xxscreeps/node_modules/koa-compose/index.js:42:32)
    at /Users/connorshea/code/xxscreeps/node_modules/koa-compose/index.js:34:12
    at dispatch (/Users/connorshea/code/xxscreeps/node_modules/koa-router/lib/router.js:377:31)
    at dispatch (/Users/connorshea/code/xxscreeps/node_modules/koa-compose/index.js:42:32)
    at null.<anonymous> (/Users/connorshea/code/xxscreeps/src/mods/backend/password/backend.ts:34:10)
    at dispatch (/Users/connorshea/code/xxscreeps/node_modules/koa-compose/index.js:42:32)
connorshea commented 3 years ago

One thing I did notice from the code is that this doesn't use the my convenience method to determine ownership. Probably not relevant, but a nice bit of code cleanup :P https://github.com/laverdet/xxscreeps/blob/e5551bfa91aa6eb1d2906efe42cbe531c4214326/src/mods/defense/processor.ts#L84